CMake/Modules/TestBigEndian.c
2004-01-21 15:08:55 -05:00

11 lines
190 B
C

int main () {
/* Are we little or big endian? From Harbison&Steele. */
union
{
long l;
char c[sizeof (long)];
} u;
u.l = 1;
return (u.c[sizeof (long) - 1] == 1)?1:0;
}