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)
#undef HAVE_SYS_SOCKET_H
#undef HAVE_SYS_ISA_DEFS_H
#undef HAVE_ENDIAN_H
+#undef HAVE_MACHINE_ENDIAN_H
#undef HAVE_STRERROR
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
#else
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#else
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
#endif
#endif
#endif
+#endif
#include "common.h"
#include "SDCCpeeph.h"
#include <string.h>
#include <assert.h>
+#if defined(__APPLE__) && (__MACH__)
+#ifdef _G
+#undef _G
+#endif
+#endif
+
#include "SDCCglobl.h"
#include "SDCCmem.h"
#include "SDCCast.h"
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
#else
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#else
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
#endif
#endif
#endif
+#endif
#define BETTER_LITERAL_SHIFT
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
#else
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#else
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
#endif
#endif
#endif
+#endif
#include "common.h"
#include "SDCCpeeph.h"
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
#else
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#else
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
#endif
#endif
#endif
+#endif
#include "common.h"
#include "SDCCpeeph.h"
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
#else
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#else
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
#endif
#endif
#endif
+#endif
#include "common.h"
#include "SDCCpeeph.h"
/* 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 <sys/stat.h>