• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

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 }

Generated on Wed Oct 13 2010 12:09:29 for GRASS Programmer's Manual by  doxygen 1.7.1