Add a function to test indianness of the platform
This commit is contained in:
20
src/littlebigman.c
Normal file
20
src/littlebigman.c
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* littlebigman.c
|
||||
*
|
||||
* Created on: 23 mai 2015
|
||||
* Author: coissac
|
||||
*/
|
||||
|
||||
#include <littlebigman.h>
|
||||
|
||||
bool islittlend()
|
||||
{
|
||||
union { int entier;
|
||||
char caractere[4] ;
|
||||
} test;
|
||||
|
||||
test.entier=0x01020304;
|
||||
|
||||
return (test.caractere[3] == 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user