4 static int litend(void) {
6 ((char *) (&i))[0] = 1;
10 static int bigend(void) {
15 printf("#ifndef __ENDIAN_H\n");
16 printf("#define __ENDIAN_H\n");
18 printf("#define __LITTLE_ENDIAN 1234\n");
19 printf("#define __BIG_ENDIAN 4321\n");
20 printf("#define __BYTE_ORDER __%s_ENDIAN\n",
21 litend() ? "LITTLE" : "BIG");
23 printf("#endif /* __ENDIAN_H */\n");