annotate endianchk.c @ 67:cf85b8c08214

Added tag rel-1_96 for changeset 1bd4e39c600b
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 24 May 2012 23:46:53 +0300
parents c3622b53a23e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #include <stdio.h>
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 int main(int argc, char *argv[])
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 {
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 int val = 1, ret;
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 char *s = (char *) &val;
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 ret = (int)(*s);
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 printf("%s\n", ret ? "-DLITTLE_ENDIAN" : "-DBIG_ENDIAN");
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 return 0;
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 }
c3622b53a23e Clean up the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11