summaryrefslogtreecommitdiffstats
path: root/Modules/TestBigEndian.c
blob: 97647edd0c0262af3fb376a2d27518e595c2b125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int main (int ac, char*av[]) {
  int ret = 1;
  /* Are we little or big endian?  From Harbison&Steele.  */
  union
  {
    long l;
    char c[sizeof (long)];
  } u;
  u.l = 1;
  if(ac > 100)
    {
    ret = *av[0];
    }
  return (u.c[sizeof (long) - 1] == 1)?ret:0;
}