X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sdccconf_in.h;h=cd08da4a9ce3afb0e5ee28ad79705a445f6736cf;hb=bb226788dab3832b0ec0cda70874ce3fce4eebc6;hp=a7221d871c921cb368913ae5026afd8b6d647248;hpb=3496b9c93e952c27e5310e3804f9dcbf9c3795ee;p=fw%2Fsdcc diff --git a/sdccconf_in.h b/sdccconf_in.h index a7221d87..cd08da4a 100644 --- a/sdccconf_in.h +++ b/sdccconf_in.h @@ -39,9 +39,6 @@ #undef STD_DS400_LIB #undef STD_XA51_LIB -#undef HAVE_SYS_SOCKET_H -#undef HAVE_MALLOC_H - #undef HAVE_STRERROR #undef HAVE_VSNPRINTF #undef HAVE_SNPRINTF @@ -53,11 +50,35 @@ #undef TYPE_BYTE #undef TYPE_WORD #undef TYPE_DWORD -#define TYPE_UBYTE unsigned TYPE_BYTE -#define TYPE_UWORD unsigned TYPE_WORD -#define TYPE_UDWORD unsigned TYPE_DWORD +#undef TYPE_UBYTE +#undef TYPE_UWORD +#undef TYPE_UDWORD -#undef WORDS_BIGENDIAN +/* + * find out the endianess of host machine + * in order to be able to make Mac OS X unified binaries + */ +/* This is tricky since these might be defined with a blank replacement list */ +/* such as on SPARC Solaris. However, configure gets it right, so it's ok */ +/* that (_BIG_ENDIAN+0) is false, even though it is defined. */ +#if (__BIG_ENDIAN__+0) || (_BIG_ENDIAN+0) +/* 1) trust the compiler */ +# define WORDS_BIGENDIAN 1 +#elif __LITTLE_ENDIAN__ +/* do nothing */ +#elif (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) +/* 2) trust the header files */ +# if BYTE_ORDER == BIG_ENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#else +/* 3) trust the configure; this actually doesn't work for unified Mac OS X binaries :-( */ +# undef BUILD_WORDS_BIGENDIAN +# if (defined BUILD_WORDS_BIGENDIAN && BUILD_WORDS_BIGENDIAN) +# define WORDS_BIGENDIAN 1 +# endif +/* 4) assume that host is a little endian machine */ +#endif #undef OPT_DISABLE_MCS51 #undef OPT_DISABLE_GBZ80