Merge pull request #7604 from Robyt3/Endianness-Check

Add compile time errors for unsupported endianness
This commit is contained in:
heinrich5991 2023-12-08 16:13:17 +00:00 committed by GitHub
commit 0c33be1692
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View file

@ -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

View file

@ -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)))