Skip to content
Permalink
Browse files
Updated byte order tests to match what SDL does now.
That is: you're more likely to be on Linux or a little-endian machine,
so deal with the non-Linux bigendian as the exceptional case.
  • Loading branch information
icculus committed Feb 25, 2016
1 parent 32d4f45 commit c3cc732a702abf0bc87314199e9f52bb83333ce8
Showing with 12 additions and 10 deletions.
  1. +12 −10 src/physfs_internal.h
@@ -131,18 +131,20 @@ void __PHYSFS_smallFree(void *ptr);
#define PHYSFS_LIL_ENDIAN 1234
#define PHYSFS_BIG_ENDIAN 4321

#if defined(__i386__) || defined(__ia64__) || \
defined(_M_IX86) || defined(_M_IA64) || defined(_M_X64) || \
(defined(__alpha__) || defined(__alpha)) || \
defined(__arm__) || defined(ARM) || defined(_M_ARM) || \
(defined(__mips__) && defined(__MIPSEL__)) || \
defined(__SYMBIAN32__) || \
defined(__x86_64__) || \
defined(__LITTLE_ENDIAN__)
#define PHYSFS_BYTEORDER PHYSFS_LIL_ENDIAN
#ifdef __linux__
#include <endian.h>
#define PHYSFS_BYTEORDER __BYTE_ORDER
#else /* __linux__ */
#if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MISPEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__sparc__)
#define PHYSFS_BYTEORDER PHYSFS_BIG_ENDIAN
#else
#define PHYSFS_BYTEORDER PHYSFS_BIG_ENDIAN
#define PHYSFS_BYTEORDER PHYSFS_LIL_ENDIAN
#endif
#endif /* __linux__ */


/*

0 comments on commit c3cc732

Please sign in to comment.