Mercurial > hg > sidinfo
annotate endianchk.c @ 116:d062312ea850
Fix th_strndup_trim() usage.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 15 Feb 2016 12:00:32 +0200 |
parents | 8e7e08bf7b9e |
children | 9a0aeb9ce9ba |
rev | line source |
---|---|
0 | 1 #include <stdio.h> |
2 | |
3 int main(int argc, char *argv[]) | |
4 { | |
5 int val = 1, ret; | |
6 char *s = (char *) &val; | |
7 (void) argc; | |
8 (void) argv; | |
9 ret = (int)(*s); | |
10 printf( | |
11 "#ifndef MY_CONFIG_H\n" | |
12 "#define MY_CONFIG_H 1\n" | |
13 "\n" | |
14 "#define TH_BYTEORDER TH_%s_ENDIAN\n" | |
15 "\n" | |
16 "#endif /* MY_CONFIG_H */\n" | |
17 , | |
18 ret ? "LITTLE" : "BIG" | |
19 ); | |
20 return 0; | |
21 } | |
22 |