]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
try harder to identify little endian cpus when BYTE_ORDER is undefined
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 11 Jan 2007 04:43:48 +0000 (04:43 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 11 Jan 2007 04:43:48 +0000 (04:43 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6681 d7cf8633-e32d-0410-b094-e92efae38249

common.h

index 485d3eb60de90a2b524da0f39855737929030950..64eecf312f9d741b4de04441bd1df14940754b9d 100644 (file)
--- a/common.h
+++ b/common.h
@@ -84,8 +84,9 @@ void Com_BlockFullChecksum (void *buffer, int len, unsigned char *outbuf);
 #endif
 
 // If we still don't know the CPU endianess at this point, we try to guess
+// normally including sys/types.h includes endian.h for the platform, which defines BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN, however endian.h is a BSD-ism, and may not be present on all platforms (particularly windows)
 #ifndef BYTE_ORDER
-# if defined(WIN32)
+# if defined(WIN32) || defined (__i386) || defined(__amd64)
 #  define BYTE_ORDER LITTLE_ENDIAN
 # else
 #  if defined(SUNOS)