/* 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
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
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
/* 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>