From: havoc Date: Thu, 11 Jan 2007 04:43:48 +0000 (+0000) Subject: try harder to identify little endian cpus when BYTE_ORDER is undefined X-Git-Tag: xonotic-v0.1.0preview~3723 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f1a131e62be1116c71c2ee5a64ed96e402c9327e;p=xonotic%2Fdarkplaces.git try harder to identify little endian cpus when BYTE_ORDER is undefined git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6681 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/common.h b/common.h index 485d3eb6..64eecf31 100644 --- 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)