diff --git a/CMakeLists.txt b/CMakeLists.txt index 6dcaed0a..eb1c6399 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,14 @@ if(PLASMA_TARGETS STREQUAL "Ethereal") add_definitions(-DSTREAM_LOGGER) endif(PLASMA_TARGETS STREQUAL "Ethereal") +INCLUDE(TestBigEndian) +TEST_BIG_ENDIAN(BIG_ENDIAN) +IF(BIG_ENDIAN) + ADD_DEFINITIONS(-DBIG_ENDIAN) +ELSE() + ADD_DEFINITIONS(-DLITTLE_ENDIAN) +ENDIF() + if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_SCL_SECURE_NO_WARNINGS) diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h index 29f2eeb1..51e2837d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h @@ -40,22 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // use little-endian as the "native" language of our network messages. -/***************************************************************************** -* -* Types and constants -* -***/ - -#ifdef _M_IX86 -# define LITTLE_ENDIAN 1 -#else -# 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 - - /***************************************************************************** * * Little endian functions diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h index 0af9a71e..d4e60a7e 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h @@ -80,7 +80,7 @@ bool GuidFromHex (const byte buf[], unsigned length, Uuid * uuid); * ***/ -#include +#include struct Uuid { union { dword dwords[4]; @@ -98,6 +98,6 @@ struct Uuid { inline bool operator != (const Uuid & rhs) const { return !GuidsAreEqual(*this, rhs); } inline bool operator != (int rhs) const { ASSERT(!rhs); return !GuidsAreEqual(*this, kNilGuid); } }; -#include +#include