Skip to content

Commit

Permalink
Get rid of __inline__, just make sure "inline" is defined sanely inst…
Browse files Browse the repository at this point in the history
…ead.
  • Loading branch information
icculus committed Aug 21, 2010
1 parent d797ea7 commit 3dc77f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
14 changes: 3 additions & 11 deletions src/physfs_byteorder.c
Expand Up @@ -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 */
Expand Down
9 changes: 8 additions & 1 deletion src/physfs_internal.h
Expand Up @@ -32,7 +32,6 @@
/* !!! FIXME: if HAVE_ALLOCA_H would be good, too. */
#if sun
#include <alloca.h>
#define __inline__ inline
#endif

#if defined(__sun) || defined(sun)
Expand All @@ -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
Expand Down

0 comments on commit 3dc77f8

Please sign in to comment.