diff --git a/source/lib/byte_order.cpp b/source/lib/byte_order.cpp index e9159ee080..8d42dcb314 100644 --- a/source/lib/byte_order.cpp +++ b/source/lib/byte_order.cpp @@ -1,6 +1,7 @@ #include "precompiled.h" #include "byte_order.h" +#include "sdl.h" u16 read_le16(const void* p) diff --git a/source/lib/byte_order.h b/source/lib/byte_order.h index 782b76d0bb..5b8cda41da 100644 --- a/source/lib/byte_order.h +++ b/source/lib/byte_order.h @@ -1,4 +1,4 @@ -#include "sdl.h" +#include "config.h" // converts 4 character string to u32 for easy comparison // can't pass code as string, and use s[0]..s[3], because @@ -9,7 +9,7 @@ // the additional u8 cast ensures each character is treated as unsigned // (otherwise, they'd be promoted to signed int before the u32 cast, // which would break things). -#if SDL_BYTE_ORDER == SDL_BIG_ENDIAN +#ifdef BIG_ENDIAN #define FOURCC(a,b,c,d) ( ((u32)(u8)a) << 24 | ((u32)(u8)b) << 16 | \ ((u32)(u8)c) << 8 | ((u32)(u8)d) << 0 ) #else diff --git a/source/lib/config.h b/source/lib/config.h index c2af33d43b..91c8b75921 100755 --- a/source/lib/config.h +++ b/source/lib/config.h @@ -74,6 +74,18 @@ # error "unknown OS - add define here" #endif +// byte order +#if defined(__i386__) || defined(__i386) || defined(_M_IX86) || \ + defined(__ia64__) || defined(__ia64) || defined(_M_IA64) || \ + defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) || \ + defined(__arm__) || \ + defined(__MIPSEL__) || \ + defined(__LITTLE_ENDIAN__) +# define LITTLE_ENDIAN +#else +# define BIG_ENDIAN +#endif + //----------------------------------------------------------------------------- // auto-detect platform features, given the above information @@ -133,4 +145,6 @@ # undef HAVE_VC_DEBUG_ALLOC #endif +// _CPPLIB_VER + #endif // #ifndef CONFIG_H_INCLUDED diff --git a/source/lib/precompiled.h b/source/lib/precompiled.h index 6fd59219f6..e22e6c990b 100755 --- a/source/lib/precompiled.h +++ b/source/lib/precompiled.h @@ -56,36 +56,65 @@ #ifdef HAVE_PCH +// all new-form C library headers #include #include -#include -#include +#include #include +//#include + // defines e.g. "and" to "&". unnecessary and causes trouble with asm. +#include +#include +#include #include +#include #include #include #include #include +#include #include #include +#include +// all C++98 STL headers #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// all other C++98 headers +#include +#include #include #include -#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include +#include #include -#include +#include +#include +#include +// STL extensions #ifdef __GNUC__ # include # include @@ -94,6 +123,7 @@ # include #endif + // CStr is included very frequently, so a reasonable amount of time is saved // by including it here. (~10% in a full rebuild, as of r2365) #include "ps/CStr.h"