GRASS Programmer's Manual 6.4.1(2011)
endian.c
Go to the documentation of this file.
00001 
00029 int G_is_little_endian(void)
00030 {
00031     union
00032     {
00033         int testWord;
00034         char testByte[sizeof(int)];
00035     } endianTest;
00036 
00037     endianTest.testWord = 1;
00038 
00039     if (endianTest.testByte[0] == 1)
00040         return 1;               /* true: little endian */
00041 
00042     return 0;                   /* false: big endian */
00043 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines