From 3dc77f8a548b65a9879fb95fa5719b56f408d430 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 21 Aug 2010 14:29:40 -0400 Subject: [PATCH] Get rid of __inline__, just make sure "inline" is defined sanely instead. --- src/physfs_byteorder.c | 14 +++----------- src/physfs_internal.h | 9 ++++++++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/physfs_byteorder.c b/src/physfs_byteorder.c index 71c13a08..6123c7fa 100644 --- a/src/physfs_byteorder.c +++ b/src/physfs_byteorder.c @@ -14,29 +14,21 @@ #define __PHYSICSFS_INTERNAL__ #include "physfs_internal.h" -#if (defined macintosh) && !(defined __MWERKS__) -#define __inline__ -#endif - -#if (defined _MSC_VER) -#define __inline__ __inline -#endif - #ifndef PHYSFS_Swap16 -static __inline__ PHYSFS_uint16 PHYSFS_Swap16(PHYSFS_uint16 D) +static inline PHYSFS_uint16 PHYSFS_Swap16(PHYSFS_uint16 D) { return ((D<<8)|(D>>8)); } #endif #ifndef PHYSFS_Swap32 -static __inline__ PHYSFS_uint32 PHYSFS_Swap32(PHYSFS_uint32 D) +static inline PHYSFS_uint32 PHYSFS_Swap32(PHYSFS_uint32 D) { return ((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000FF00)|(D>>24)); } #endif #ifndef PHYSFS_NO_64BIT_SUPPORT #ifndef PHYSFS_Swap64 -static __inline__ PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) { +static inline PHYSFS_uint64 PHYSFS_Swap64(PHYSFS_uint64 val) { PHYSFS_uint32 hi, lo; /* Separate into high and low 32-bit values and swap them */ diff --git a/src/physfs_internal.h b/src/physfs_internal.h index 865a7045..aa361f5e 100644 --- a/src/physfs_internal.h +++ b/src/physfs_internal.h @@ -32,7 +32,6 @@ /* !!! FIXME: if HAVE_ALLOCA_H would be good, too. */ #if sun #include -#define __inline__ inline #endif #if defined(__sun) || defined(sun) @@ -50,6 +49,14 @@ extern "C" { #define PHYSFS_MINIMUM_GCC_VERSION(major, minor) (0) #endif +#ifdef __cplusplus + /* C++ always has a real inline keyword. */ +#elif (defined macintosh) && !(defined __MWERKS__) +# define inline +#elif (defined _MSC_VER) +# define inline __inline +#endif + /* * Interface for small allocations. If you need a little scratch space for * a throwaway buffer or string, use this. It will make small allocations