From 8315157349bc1a98613bcc9c6e3a6bec532b4691 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 16 May 2018 00:21:24 +0200 Subject: Optimize for little endian instead of big endian --- tests/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/main.cpp b/tests/main.cpp index 4b6c7a7..e879e6a 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -15,6 +15,15 @@ struct TestStruct int main() { +#if BYTE_ORDER == BIG_ENDIAN + const char *endianessStr = "big"; +#elif BYTE_ORDER == LITTLE_ENDIAN + const char *endianessStr = "little"; +#else + const char *endianessStr = "Unknown"; +#endif + printf("System endianess: %s\n", endianessStr); + TestStruct expectedTestStruct; expectedTestStruct.a = 0x38956326; expectedTestStruct.b = 0x34; -- cgit v1.2.3