summaryrefslogtreecommitdiffstats
path: root/Modules/TestBigEndian.c
blob: c21cc7e490453b99c1601dd80e5e4bbcbce403d4 (plain)
1
2
3
4
5
6
7
8
9
10
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;
}