Skip to content

Commit

Permalink
Buildfixes for MSVC/C89
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Feb 24, 2024
1 parent f115148 commit fae36f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
15 changes: 2 additions & 13 deletions src/fceu-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,8 @@ typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;

#ifdef __GNUC__
typedef unsigned long long uint64;
typedef long long int64;
#elif MSVC | _MSC_VER
typedef __int64 int64;
typedef unsigned __int64 uint64;
#else
typedef unsigned long long uint64;
typedef long long int64;
#endif

#define FCEU_UNUSED(x) (void)(x)
#define FCEU_MAYBE_UNUSED __attribute__((unused))
typedef uint64_t uint64;
typedef int64_t int64;

#if !defined(FALSE)
#define FALSE 0
Expand Down
1 change: 0 additions & 1 deletion src/fceu.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ void ResetNES(void) {

static int ram_init_seed = 0;

FCEU_MAYBE_UNUSED
static uint64 splitmix64(uint32 input) {
uint64 z = (input + 0x9e3779b97f4a7c15);
z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9;
Expand Down
2 changes: 1 addition & 1 deletion src/pputile.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ uint8 tmpd;
#endif

#ifndef PPUT_MMC5SP
FCEU_MAYBE_UNUSED uint8 zz;
uint8 zz;
#else
uint8 xs, ys;
xs = X1;
Expand Down
4 changes: 2 additions & 2 deletions src/x6502.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ redundant) on the variable "x".
#define LD_ZP(op) { uint8 A; uint8 x; GetZP(A); x = RdRAM(A); op; break; }
#define LD_ZPX(op) { uint8 A; uint8 x; GetZPI(A, cpu.X); x = RdRAM(A); op; break; }
#define LD_ZPY(op) { uint8 A; uint8 x; GetZPI(A, cpu.Y); x = RdRAM(A); op; break; }
#define LD_AB(op) { uint16 A; uint8 x; FCEU_UNUSED(x); GetAB(A); x = RdMem(A); op; break; }
#define LD_ABI(reg, op) { uint16 A; uint8 x; FCEU_UNUSED(x); GetABIRD(A, reg); x = RdMem(A); op; break; }
#define LD_AB(op) { uint16 A; uint8 x; GetAB(A); x = RdMem(A); op; break; }
#define LD_ABI(reg, op) { uint16 A; uint8 x; GetABIRD(A, reg); x = RdMem(A); op; break; }
#define LD_ABX(op) LD_ABI(cpu.X, op)
#define LD_ABY(op) LD_ABI(cpu.Y, op)
#define LD_IX(op) { uint16 A; uint8 x; GetIX(A); x = RdMem(A); op; break; }
Expand Down

0 comments on commit fae36f1

Please sign in to comment.