From d14938029f2fd84114f470a7e7c62cb69d32e9d8 Mon Sep 17 00:00:00 2001 From: philippelatulippe Date: Fri, 22 Apr 2011 21:13:39 -0400 Subject: [PATCH] Fix compile-time endianness check to work on linux. As the original comment says, it's still not very robust. --- Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h index 29f2eeb1..ca3f8976 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h @@ -46,13 +46,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef _M_IX86 -# define LITTLE_ENDIAN 1 +#if defined(_M_IX86) || defined(i386) || defined(__i386__) || defined(__i386) +# ifndef LITTLE_ENDIAN +# define LITTLE_ENDIAN 1 +# endif #else -# define BIG_ENDIAN 1 +# ifndef BIG_ENDIAN +# define BIG_ENDIAN 1 // That was a pretty weak check for endian-ness, if it // failed then we probably need to strengthen it a bit. # error "Are you sure this is a big-endian CPU?" +# endif #endif