1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Use cmake's TestBigEndian to set BIG_ENDIAN or LITTLE_ENDIAN.

This commit is contained in:
philippelatulippe
2011-04-23 20:43:03 -04:00
parent d14938029f
commit 62a6757ea6
2 changed files with 8 additions and 20 deletions

View File

@ -69,6 +69,14 @@ if(PLASMA_TARGETS STREQUAL "Ethereal")
add_definitions(-DSTREAM_LOGGER) add_definitions(-DSTREAM_LOGGER)
endif(PLASMA_TARGETS STREQUAL "Ethereal") 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) if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_WARNINGS) add_definitions(-D_SCL_SECURE_NO_WARNINGS)

View File

@ -40,26 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// use little-endian as the "native" language of our network messages. // use little-endian as the "native" language of our network messages.
/*****************************************************************************
*
* Types and constants
*
***/
#if defined(_M_IX86) || defined(i386) || defined(__i386__) || defined(__i386)
# ifndef LITTLE_ENDIAN
# define LITTLE_ENDIAN 1
# endif
#else
# 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
/***************************************************************************** /*****************************************************************************
* *
* Little endian functions * Little endian functions