Some problems I stumbled across while making FBA libsnes for Xbox 360 -
MSVC only supports C89 - and 'inline' isn't supported. I have to compile certain files as C (such as ym2413.c). Unfortunately, they make certain assumptions - such as 'inline' being available which isn't the case for Xbox 360 at least (when compiling C code).
In ym2413.c
#define MAME_INLINE static inline
What I do instead is make a preprocessor define where I redefine MAME_INLINE, such as:
MAME_INLINE="_inline static".
To allow this to work, there needs to be an ifndef wrapped around that define.
So change in ym2413.c - this:
#define MAME_INLINE static inline
to:
#ifndef MAME_INLINE
#define MAME_INLINE static inline
#endif
There is a similar issue going on with the SH2 CPU core (cpu/sh2/sh2.cpp):
#define SH2_INLINE
I define SH2_INLINE as a preprocessor switch because compiling without inlining these functions gives me horrendous performance on PS3. So if we could include a guard against defining this as well, such as:
#ifndef SH2_INLINE
#define SH2_INLINE
#endif
There are similar issues in src/burn/state.h -
inline static void ScanVar(void* pv, INT32 nSize, char* szName)
Include something like this just after the #ifdef __cplusplus define:
#if !defined(__cplusplus) && defined(_XBOX)
#define C_INLINE _inline
#else
#define C_INLINE inline
#endif
and then use it like this in the rest of the header wherever inline is being used:
C_INLINE static void ScanVar(void* pv, INT32 nSize, char* szName)
That should take care of my issues.