summaryrefslogtreecommitdiffstats
path: root/config.tests/unix/endian/endiantest.cpp
blob: d4133cd773a0c01dc21860bf95fde2765d88e2f1 (plain)
1
2
3
4
5
6
7
8
int main(int, char **)
{
    unsigned char bytes[] = { 0x01, 0x02, 0x03, 0x04 };
    unsigned int *integer = (unsigned int *) bytes;
    return (*integer == 0x01020304 ?
	    0 : // big endian
	    1);  // little endian
}