]> git.saurik.com Git - bison.git/blobdiff - src/system.h
* tests/regression.at, tests/torture.at, tests/calc.at: Adjust to
[bison.git] / src / system.h
index b8a73edbdc27effa05559fc53000a395976277f6..8d480333b61f45298cea700fd0bfece8cd5f5f4d 100644 (file)
 extern int errno;
 #endif
 
+/* AIX requires this to be the first thing in the file.  */
+#ifndef __GNUC__
+# if HAVE_ALLOCA_H
+#  include <alloca.h>
+# else
+#  ifdef _AIX
+ #pragma alloca
+#  else
+#   ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+#   endif
+#  endif
+# endif
+#endif
+
 #if PROTOTYPES
 # define PARAMS(p) p
 #else
@@ -95,14 +110,26 @@ extern int errno;
 char *stpcpy PARAMS ((char *dest, const char *src));
 #endif
 
-#if !HAVE_DECL_STRNDUP
-char *strndup PARAMS ((const char *s, size_t size));
+#if !HAVE_DECL_STRCHR
+char *strchr(const char *s, int c);
+#endif
+
+#if !HAVE_DECL_STRSPN
+size_t strspn(const char *s, const char *accept);
 #endif
 
 #if !HAVE_DECL_STRNLEN
 size_t strnlen PARAMS ((const char *s, size_t maxlen));
 #endif
 
+#if !HAVE_DECL_MEMCHR
+void *memchr PARAMS ((const void *s, int c, size_t n));
+#endif
+
+#if !HAVE_DECL_MEMRCHR
+void *memrchr PARAMS ((const void *s, int c, size_t n));
+#endif
+
 
 
 /*-----------------.
@@ -111,7 +138,8 @@ size_t strnlen PARAMS ((const char *s, size_t maxlen));
 
 #ifndef __attribute__
 /* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+# if !defined (__GNUC__) || __GNUC__ < 2 || \
+(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
 #  define __attribute__(Spec) /* empty */
 # endif
 /* The __-protected variants of `format' and `printf' attributes
@@ -134,20 +162,9 @@ size_t strnlen PARAMS ((const char *s, size_t maxlen));
 # define setlocale(Category, Locale)
 #endif
 
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# undef  bindtextdomain
-# define bindtextdomain(Domain, Directory)
-# undef  textdomain
-# define textdomain(Domain)
-# undef  ngettext
-# define ngettext(Singular, Plural, Number)   \
-         ((Number == 1) ? Singular : Plural)
-# define _(Text) Text
-#endif
-#define N_(Text) Text
+#include "libgettext.h"
+#define _(Msgid)  gettext (Msgid)
+#define N_(Msgid) (Msgid)
 
 
 /*-------------------------------.