annotate endianchk.c @ 71:a87eb778f225

Improvements to the MinGW crossbuild. Should now build with default tools from Debian mingw packages, though you need Win32 version of libSDL with the necessary headers and so on in addition. 64-bit builds not tested and probably won't work. Tested on Debian 7.0, earlier won't work. binutils-mingw-w64-i686 gcc-mingw-w64-i686 mingw-w64-i686-dev
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 Aug 2012 03:08:10 +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