Stripped much crap out of configure system; should now build on MacOS X
[fw/sdcc] / support / cpp2 / system.h
index 8486185ee8fd67819602b4c4441c0e8748b127ba..b6324ab9a83095ffa189d7b69f59e2d3a5888567 100644 (file)
@@ -61,7 +61,11 @@ Boston, MA 02111-1307, USA.  */
 /* There are an extraordinary number of issues with <ctype.h>.
    The last straw is that it varies with the locale.  Use libiberty's
    replacement instead.  */
+#if defined(__APPLE__) && defined(__MACH__)
+#include <libiberty/safe-ctype.h>
+#else
 #include <safe-ctype.h>
+#endif
 
 /* Define a default escape character; it's different for EBCDIC.  */
 #ifndef TARGET_ESC
@@ -231,26 +235,10 @@ extern long atol PARAMS ((const char *));
 extern void free PARAMS ((PTR));
 #endif
 
-#if defined (HAVE_DECL_GETCWD) && !HAVE_DECL_GETCWD
-extern char *getcwd PARAMS ((char *, size_t));
-#endif
-
 #if defined (HAVE_DECL_GETENV) && !HAVE_DECL_GETENV
 extern char *getenv PARAMS ((const char *));
 #endif
 
-#if defined (HAVE_DECL_GETOPT) && !HAVE_DECL_GETOPT
-extern int getopt PARAMS ((int, char * const *, const char *));
-#endif
-
-#if defined (HAVE_DECL_GETWD) && !HAVE_DECL_GETWD
-extern char *getwd PARAMS ((char *));
-#endif
-
-#if defined (HAVE_DECL_SBRK) && !HAVE_DECL_SBRK
-extern PTR sbrk PARAMS ((int));
-#endif
-
 #if defined (HAVE_DECL_STRSTR) && !HAVE_DECL_STRSTR
 extern char *strstr PARAMS ((const char *, const char *));
 #endif
@@ -271,28 +259,6 @@ extern PTR calloc PARAMS ((size_t, size_t));
 extern PTR realloc PARAMS ((PTR, size_t));
 #endif
 
-#ifdef HAVE_GETRLIMIT
-# if defined (HAVE_DECL_GETRLIMIT) && !HAVE_DECL_GETRLIMIT
-#  ifndef getrlimit
-#   ifdef ANSI_PROTOTYPES
-struct rlimit;
-#   endif
-extern int getrlimit PARAMS ((int, struct rlimit *));
-#  endif
-# endif
-#endif
-
-#ifdef HAVE_SETRLIMIT
-# if defined (HAVE_DECL_SETRLIMIT) && !HAVE_DECL_SETRLIMIT
-#  ifndef setrlimit
-#   ifdef ANSI_PROTOTYPES
-struct rlimit;
-#   endif
-extern int setrlimit PARAMS ((int, const struct rlimit *));
-#  endif
-# endif
-#endif
-
 #if !defined(__STDC__) && !defined(volatile)
 #define volatile
 #endif
@@ -303,9 +269,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 <sys/stat.h>