mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #7604 from Robyt3/Endianness-Check
Add compile time errors for unsupported endianness
This commit is contained in:
commit
0c33be1692
|
@ -195,4 +195,12 @@
|
|||
#define CONF_ARCH_STRING "unknown"
|
||||
#endif
|
||||
|
||||
#if defined(CONF_ARCH_ENDIAN_LITTLE)
|
||||
#define CONF_ARCH_ENDIAN_STRING "little endian"
|
||||
#elif defined(CONF_ARCH_ENDIAN_BIG)
|
||||
#define CONF_ARCH_ENDIAN_STRING "big endian"
|
||||
#else
|
||||
#error "Unsupported endianness"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -49,15 +49,8 @@ public:
|
|||
str_copy(m_aAppName, pAppname);
|
||||
if(!Test)
|
||||
{
|
||||
//
|
||||
dbg_msg("engine", "running on %s-%s-%s", CONF_FAMILY_STRING, CONF_PLATFORM_STRING, CONF_ARCH_STRING);
|
||||
#ifdef CONF_ARCH_ENDIAN_LITTLE
|
||||
dbg_msg("engine", "arch is little endian");
|
||||
#elif defined(CONF_ARCH_ENDIAN_BIG)
|
||||
dbg_msg("engine", "arch is big endian");
|
||||
#else
|
||||
dbg_msg("engine", "unknown endian");
|
||||
#endif
|
||||
dbg_msg("engine", "arch is %s", CONF_ARCH_ENDIAN_STRING);
|
||||
|
||||
char aVersionStr[128];
|
||||
if(os_version_str(aVersionStr, sizeof(aVersionStr)))
|
||||
|
|
Loading…
Reference in a new issue