Skip to content
Snippets Groups Projects
Commit 5d2b4c69 authored by Virgile Prevosto's avatar Virgile Prevosto Committed by Andre Maroneze
Browse files

[machdeps] update little_endian.c for compile-time detection

parent 109ab534
No related branches found
No related tags found
No related merge requests found
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
#if defined(__BYTE_ORDER__) #if defined(__BYTE_ORDER__)
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
__attribute__((section(".data"))) unsigned char little_endian = 0xf4; _Static_assert(0,"little_endian is False");
#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
__attribute__((section(".data"))) unsigned char little_endian = 0x15; _Static_assert(0,"little_endian is True");
#else #else
#error Unexpected __BYTE_ORDER__ #error Unexpected __BYTE_ORDER__
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment