From: kbongers Date: Thu, 27 Sep 2001 22:04:24 +0000 (+0000) Subject: adjust for mach os-x support X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=648671f93830aad38410d5f010e67992a8a43601;p=fw%2Fsdcc adjust for mach os-x support git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1317 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/configure.in b/configure.in index af1c19b5..1f4f1bf9 100755 --- a/configure.in +++ b/configure.in @@ -65,6 +65,7 @@ AC_HEADER_STDC AC_CHECK_HEADERS(getopt.h) AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(endian.h) +AC_CHECK_HEADERS(machine/endian.h) AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(sys/isa_defs.h) AC_CHECK_HEADERS(sys/socket.h) diff --git a/sdccconf_in.h b/sdccconf_in.h index a9afbb9f..df659b19 100644 --- a/sdccconf_in.h +++ b/sdccconf_in.h @@ -25,6 +25,7 @@ #undef HAVE_SYS_SOCKET_H #undef HAVE_SYS_ISA_DEFS_H #undef HAVE_ENDIAN_H +#undef HAVE_MACHINE_ENDIAN_H #undef HAVE_STRERROR diff --git a/src/avr/gen.c b/src/avr/gen.c index cd262f6e..faf4c36c 100644 --- a/src/avr/gen.c +++ b/src/avr/gen.c @@ -34,6 +34,9 @@ #ifdef HAVE_SYS_ISA_DEFS_H #include #else +#ifdef HAVE_MACHINE_ENDIAN_H +#include +#else #ifdef HAVE_ENDIAN_H #include #else @@ -43,6 +46,7 @@ #endif #endif #endif +#endif #include "common.h" #include "SDCCpeeph.h" diff --git a/src/common.h b/src/common.h index 70ac2ebd..5694aa77 100644 --- a/src/common.h +++ b/src/common.h @@ -4,6 +4,12 @@ #include #include +#if defined(__APPLE__) && (__MACH__) +#ifdef _G +#undef _G +#endif +#endif + #include "SDCCglobl.h" #include "SDCCmem.h" #include "SDCCast.h" diff --git a/src/ds390/gen.c b/src/ds390/gen.c index 44699fdd..a8c10129 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -38,6 +38,9 @@ #ifdef HAVE_SYS_ISA_DEFS_H #include #else +#ifdef HAVE_MACHINE_ENDIAN_H +#include +#else #ifdef HAVE_ENDIAN_H #include #else @@ -47,6 +50,7 @@ #endif #endif #endif +#endif #define BETTER_LITERAL_SHIFT diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 38c60a98..3d9987a3 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -41,6 +41,9 @@ #ifdef HAVE_SYS_ISA_DEFS_H #include #else +#ifdef HAVE_MACHINE_ENDIAN_H +#include +#else #ifdef HAVE_ENDIAN_H #include #else @@ -50,6 +53,7 @@ #endif #endif #endif +#endif #include "common.h" #include "SDCCpeeph.h" diff --git a/src/pic/gen.c b/src/pic/gen.c index d279691c..42b0b375 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -39,6 +39,9 @@ #ifdef HAVE_SYS_ISA_DEFS_H #include #else +#ifdef HAVE_MACHINE_ENDIAN_H +#include +#else #ifdef HAVE_ENDIAN_H #include #else @@ -48,6 +51,7 @@ #endif #endif #endif +#endif #include "common.h" #include "SDCCpeeph.h" diff --git a/src/pic/genarith.c b/src/pic/genarith.c index 2622233e..643b1796 100644 --- a/src/pic/genarith.c +++ b/src/pic/genarith.c @@ -43,6 +43,9 @@ #ifdef HAVE_SYS_ISA_DEFS_H #include #else +#ifdef HAVE_MACHINE_ENDIAN_H +#include +#else #ifdef HAVE_ENDIAN_H #include #else @@ -52,6 +55,7 @@ #endif #endif #endif +#endif #include "common.h" #include "SDCCpeeph.h" diff --git a/support/cpp2/system.h b/support/cpp2/system.h index 9e89c061..ff0473d2 100644 --- a/support/cpp2/system.h +++ b/support/cpp2/system.h @@ -307,9 +307,13 @@ extern void abort PARAMS ((void)); /* 1 if we have C99 designated initializers. */ #if !defined(HAVE_DESIGNATED_INITIALIZERS) +#if defined(__APPLE__) && (__MACH__) +#define HAVE_DESIGNATED_INITIALIZERS 0 +#else #define HAVE_DESIGNATED_INITIALIZERS \ ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) #endif +#endif #if HAVE_SYS_STAT_H # include