Browse Source

Fix compile-time endianness check to work on linux. As the original comment says, it's still not very robust.

philippelatulippe 13 years ago
parent
commit
d14938029f
  1. 10
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h

10
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 #if defined(_M_IX86) || defined(i386) || defined(__i386__) || defined(__i386)
# define LITTLE_ENDIAN 1 # ifndef LITTLE_ENDIAN
# define LITTLE_ENDIAN 1
# endif
#else #else
# define BIG_ENDIAN 1 # ifndef BIG_ENDIAN
# define BIG_ENDIAN 1
// That was a pretty weak check for endian-ness, if it // That was a pretty weak check for endian-ness, if it
// failed then we probably need to strengthen it a bit. // failed then we probably need to strengthen it a bit.
# error "Are you sure this is a big-endian CPU?" # error "Are you sure this is a big-endian CPU?"
# endif
#endif #endif

Loading…
Cancel
Save