mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 06:23:04 +01:00
Platform.h: Reject big-endian systems (#23684)
Several tests fail on big-endian, indicating that the code isn't prepared
for such systems, but it wouldn't be obvious from just compiling OpenRCT2.
Make it obvious by checking it on Platform.h. Example output:
/home/user/src/OpenRCT2/src/openrct2-ui/../openrct2/platform/Platform.h:34:35: error: static assertion failed: OpenRCT2 is known to be broken on big endian. Proceed with caution!
34 | static_assert(std::endian::native == std::endian::little,
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
ninja: job failed
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "../core/DateTime.h"
|
||||
#include "../core/StringTypes.h"
|
||||
|
||||
#include <bit>
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
|
||||
@@ -31,6 +32,9 @@
|
||||
#define MAX_PATH 260
|
||||
#endif
|
||||
|
||||
static_assert(
|
||||
std::endian::native == std::endian::little, "OpenRCT2 is known to be broken on big endian. Proceed with caution!");
|
||||
|
||||
enum class SPECIAL_FOLDER
|
||||
{
|
||||
USER_CACHE,
|
||||
|
||||
Reference in New Issue
Block a user