From 4835077e00c2cf7e3dba7bf7801c6aafd9d00dbe Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 17 Mar 2014 17:37:20 +0100 Subject: [PATCH] C89 MSVC doesn't support 'inline' - will have to make define for INLINE that can be redefined by MSVC --- Makefile | 2 +- Makefile.libretro | 2 -- cpu/cz80/cz80.c | 2 +- cpu/debug.h | 2 +- cpu/sh2/compiler.c | 2 +- cpu/sh2/mame/sh2.c | 1 + cpu/sh2/mame/sh2pico.c | 4 ++-- cpu/sh2/sh2.h | 2 +- pico/32x/32x.c | 2 +- pico/pico_cmn.c | 2 +- pico/pico_int.h | 2 +- pico/videoport.c | 2 +- 12 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 7ebb8781..d8dbcb5e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ TARGET ?= PicoDrive CFLAGS += -Wall -ggdb -falign-functions=2 -CFLAGS += -I. +CFLAGS += -I. -DINLINE=inline ifndef DEBUG CFLAGS += -O2 -DNDEBUG -ffunction-sections ifeq ($(findstring clang,$(CC)),) diff --git a/Makefile.libretro b/Makefile.libretro index 48182197..76795050 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -193,9 +193,7 @@ else CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__ endif -ifeq ($(DONT_COMPILE_IN_ZLIB),1) CFLAGS += -DNO_ZLIB -endif ifeq ($(NO_MMAP),1) CFLAGS += -DNO_MMAP diff --git a/cpu/cz80/cz80.c b/cpu/cz80/cz80.c index 61ca5f84..28d762ce 100644 --- a/cpu/cz80/cz80.c +++ b/cpu/cz80/cz80.c @@ -216,7 +216,7 @@ void Cz80_Reset(cz80_struc *CPU) /* */ #if PICODRIVE_HACKS -static inline unsigned char picodrive_read(unsigned short a) +static INLINE unsigned char picodrive_read(unsigned short a) { uptr v = z80_read_map[a >> Z80_MEM_SHIFT]; if (map_flag_set(v)) diff --git a/cpu/debug.h b/cpu/debug.h index 5aaa60ee..4ad618d5 100644 --- a/cpu/debug.h +++ b/cpu/debug.h @@ -26,6 +26,6 @@ int pdb_net_connect(const char *host, const char *port); #else -static inline int pdb_net_connect(const char *host, const char *port) {return 0;} +static INLINE int pdb_net_connect(const char *host, const char *port) {return 0;} #endif diff --git a/cpu/sh2/compiler.c b/cpu/sh2/compiler.c index 25ba9d2f..2dd3430c 100644 --- a/cpu/sh2/compiler.c +++ b/cpu/sh2/compiler.c @@ -1017,7 +1017,7 @@ static void rcache_unlock_all(void) reg_temp[i].flags &= ~HRF_LOCKED; } -static inline u32 rcache_used_hreg_mask(void) +static INLINE u32 rcache_used_hreg_mask(void) { u32 mask = 0; int i; diff --git a/cpu/sh2/mame/sh2.c b/cpu/sh2/mame/sh2.c index 81203e7b..2fb964b6 100644 --- a/cpu/sh2/mame/sh2.c +++ b/cpu/sh2/mame/sh2.c @@ -108,6 +108,7 @@ //#include "debugger.h" //#include "sh2.h" //#include "sh2comn.h" +#undef INLINE #define INLINE static //CPU_DISASSEMBLE( sh2 ); diff --git a/cpu/sh2/mame/sh2pico.c b/cpu/sh2/mame/sh2pico.c index a3ad9f47..78998785 100644 --- a/cpu/sh2/mame/sh2pico.c +++ b/cpu/sh2/mame/sh2pico.c @@ -21,7 +21,7 @@ typedef unsigned char UINT8; // this nasty conversion is needed for drc-expecting memhandlers #define MAKE_READFUNC(name, cname) \ -static inline unsigned int name(SH2 *sh2, unsigned int a) \ +static INLINE unsigned int name(SH2 *sh2, unsigned int a) \ { \ unsigned int ret; \ sh2->sr |= sh2->icount << 12; \ @@ -32,7 +32,7 @@ static inline unsigned int name(SH2 *sh2, unsigned int a) \ } #define MAKE_WRITEFUNC(name, cname) \ -static inline void name(SH2 *sh2, unsigned int a, unsigned int d) \ +static INLINE void name(SH2 *sh2, unsigned int a, unsigned int d) \ { \ sh2->sr |= sh2->icount << 12; \ cname(a, d, sh2); \ diff --git a/cpu/sh2/sh2.h b/cpu/sh2/sh2.h index 1394f94a..8c37f43c 100644 --- a/cpu/sh2/sh2.h +++ b/cpu/sh2/sh2.h @@ -92,7 +92,7 @@ void sh2_unpack(SH2 *sh2, const unsigned char *buff); int sh2_execute_drc(SH2 *sh2c, int cycles); int sh2_execute_interpreter(SH2 *sh2c, int cycles); -static inline int sh2_execute(SH2 *sh2, int cycles, int use_drc) +static INLINE int sh2_execute(SH2 *sh2, int cycles, int use_drc) { int ret; diff --git a/pico/32x/32x.c b/pico/32x/32x.c index 26162e49..ddb95eca 100644 --- a/pico/32x/32x.c +++ b/pico/32x/32x.c @@ -363,7 +363,7 @@ static void p32x_run_events(unsigned int until) oldest, event_time_next); } -static inline void run_sh2(SH2 *sh2, int m68k_cycles) +static INLINE void run_sh2(SH2 *sh2, int m68k_cycles) { int cycles, done; diff --git a/pico/pico_cmn.c b/pico/pico_cmn.c index 341255a8..e8ad78d4 100644 --- a/pico/pico_cmn.c +++ b/pico/pico_cmn.c @@ -50,7 +50,7 @@ static void SekSyncM68k(void) pprof_end(m68k); } -static inline void SekRunM68k(int cyc) +static INLINE void SekRunM68k(int cyc) { SekCycleAim += cyc; SekSyncM68k(); diff --git a/pico/pico_int.h b/pico/pico_int.h index 09fb6458..f53250aa 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -907,7 +907,7 @@ void REGPARM(3) sh2_peripheral_write32(unsigned int a, unsigned int d, SH2 *sh2) #endif /* avoid dependency on newer glibc */ -static __inline int isspace_(int c) +static INLINE int isspace_(int c) { return (0x09 <= c && c <= 0x0d) || c == ' '; } diff --git a/pico/videoport.c b/pico/videoport.c index 7f37e41d..61f7f18e 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -22,7 +22,7 @@ typedef unsigned int u32; int (*PicoDmaHook)(unsigned int source, int len, unsigned short **srcp, unsigned short **limitp) = NULL; -static __inline void AutoIncrement(void) +static INLINE void AutoIncrement(void) { Pico.video.addr=(unsigned short)(Pico.video.addr+Pico.video.reg[0xf]); } -- 2.39.5