From 1c598695e433b9ac65887d156fcd78b10e6269de 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