diff options
Diffstat (limited to 'cpp/include/IceUtil/Config.h')
-rw-r--r-- | cpp/include/IceUtil/Config.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h index 28bd4f27e90..8b2e99ca0a8 100644 --- a/cpp/include/IceUtil/Config.h +++ b/cpp/include/IceUtil/Config.h @@ -16,13 +16,17 @@ // Most CPUs support only one endianness, with the notable exceptions // of Itanium (IA64) and MIPS. // +#ifdef __GLIBC__ +# include <endian.h> +#endif + #if defined(__i386) || defined(_M_IX86) || defined(__x86_64) || \ defined(_M_X64) || defined(_M_IA64) || defined(__alpha__) || \ - defined(__MIPSEL__) + defined(__MIPSEL__) || (defined(__BYTE_ORDER) && (__BYTE_ORDER == __LITTLE_ENDIAN)) # define ICE_LITTLE_ENDIAN #elif defined(__sparc) || defined(__sparc__) || defined(__hppa) || \ defined(__ppc__) || defined(__powerpc) || defined(_ARCH_COM) || \ - defined(__MIPSEB__) + defined(__MIPSEB__) || (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) # define ICE_BIG_ENDIAN #else # error "Unknown architecture" |