Updated byte order tests to match what SDL does now.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 25 Feb 2016 02:55:11 -0500
changeset 1374 c49f2eedba94
parent 1373 527ef3c6a2d6
child 1375 20ee02ea086c
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.
src/physfs_internal.h
--- a/src/physfs_internal.h	Thu Feb 25 02:51:28 2016 -0500
+++ b/src/physfs_internal.h	Thu Feb 25 02:55:11 2016 -0500
@@ -131,18 +131,20 @@
 #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__ */
 
 
 /*