diff options
Diffstat (limited to 'config/byteorder_test.c')
-rw-r--r-- | config/byteorder_test.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/config/byteorder_test.c b/config/byteorder_test.c new file mode 100644 index 0000000..0583803 --- /dev/null +++ b/config/byteorder_test.c @@ -0,0 +1,15 @@ +#include <stdio.h> + +int +main () +{ + unsigned int a = 0x1234; + + if ( (unsigned int) ( ((unsigned char *)&a)[0]) == 0x34 ) { + printf("little-endian\n"); + return 0; + } else { + printf("big-endian\n"); + return 1; + } +} |