* configure, configure.in, config.dsp, config_vc.awk,
[fw/sdcc] / as / link / asxxxx_config.h.in
1 #ifndef __ASXXXX_CONFIG_H
2 #define __ASXXXX_CONFIG_H
3
4 /*
5  * find out the endianess of host machine
6  * in order to be able to make Mac OS X unified binaries
7  */
8 /* This is tricky since these might be defined with a blank replacement list */
9 /* such as on SPARC Solaris. However, configure gets it right, so it's ok */
10 /* that (_BIG_ENDIAN+0) is false, even though it is defined. */
11 #if (__BIG_ENDIAN__+0) || (_BIG_ENDIAN+0)
12 /* 1) trust the compiler */
13 # define WORDS_BIGENDIAN 1
14 #elif __LITTLE_ENDIAN__
15 /* do nothing */
16 #elif (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
17 /* 2) trust the header files */
18 # if BYTE_ORDER == BIG_ENDIAN
19 #   define WORDS_BIGENDIAN 1
20 # endif
21 #else
22 /* 3) trust the configure; this actually doesn't work for unified Mac OS X binaries :-( */
23 # undef BUILD_WORDS_BIGENDIAN
24 # if (defined BUILD_WORDS_BIGENDIAN && BUILD_WORDS_BIGENDIAN)
25 #   define WORDS_BIGENDIAN  1
26 # endif
27 /* 4) assume that host is a little endian machine */
28 #endif
29
30 #undef TYPE_BYTE
31 #undef TYPE_WORD
32 #undef TYPE_DWORD
33 #undef TYPE_UBYTE
34 #undef TYPE_UWORD
35 #undef TYPE_UDWORD
36
37 #if !defined TYPE_WORD && defined _WIN32
38 # define TYPE_BYTE char
39 # define TYPE_WORD short
40 # define TYPE_DWORD int
41 # define TYPE_UBYTE unsigned TYPE_BYTE
42 # define TYPE_UWORD unsigned TYPE_WORD
43 # define TYPE_UDWORD unsigned TYPE_DWORD
44 #endif
45
46 #endif __ASXXXX_CONFIG_H