]> git.saurik.com Git - bison.git/blobdiff - src/system.h
* tests/calc.at, tests/output.at, tests/regression.at,
[bison.git] / src / system.h
index 83e2b0a51f0bde196afc8ac3bb2636f9b4e7b458..bfd244637a0b8fe1efb9508df6f9ea07eaf4a16e 100644 (file)
 # include <stdlib.h>
 #endif
 
+/* The following test is to work around the gross typo in
+   systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
+   is defined to 0, not 1.  */
+#if !EXIT_FAILURE
+# undef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#endif
+
+#ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+#endif
+
 #if HAVE_UNISTD_H
 # include <unistd.h>
 #endif
@@ -73,6 +85,26 @@ extern int errno;
 # define PARAMS(p) ()
 #endif
 
+# include "xalloc.h"
+
+/*---------------------.
+| Missing prototypes.  |
+`---------------------*/
+
+#if !HAVE_DECL_STPCPY
+char *stpcpy PARAMS ((char *dest, const char *src));
+#endif
+
+#if !HAVE_DECL_STRNDUP
+char *strndup PARAMS ((const char *s, size_t size));
+#endif
+
+#if !HAVE_DECL_STRNLEN
+size_t strnlen PARAMS ((const char *s, size_t maxlen));
+#endif
+
+
+
 /*-----------------.
 | GCC extensions.  |
 `-----------------*/
@@ -106,10 +138,13 @@ extern int errno;
 # include <libintl.h>
 # define _(Text) gettext (Text)
 #else
-# undef bindtextdomain
+# undef  bindtextdomain
 # define bindtextdomain(Domain, Directory)
-# undef textdomain
+# undef  textdomain
 # define textdomain(Domain)
+# undef  ngettext
+# define ngettext(Singular, Plural, Number)   \
+         ((Number == 1) ? Singular : Plural)
 # define _(Text) Text
 #endif
 #define N_(Text) Text
@@ -123,8 +158,6 @@ extern int errno;
 # define LOCALEDIR "/usr/local/share/locale"
 #endif
 
-#endif  /* BISON_SYSTEM_H */
-
 
 /*-----------.
 | Booleans.  |
@@ -141,9 +174,9 @@ typedef int bool;
 | Obstacks.  |
 `-----------*/
 
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free  free
-#include "obstack.h"
+# define obstack_chunk_alloc xmalloc
+# define obstack_chunk_free  free
+# include "obstack.h"
 
 #define obstack_sgrow(Obs, Str) \
   obstack_grow (Obs, Str, strlen (Str))
@@ -244,3 +277,15 @@ do {                                                               \
 #  define BISON_HAIRY "c:/usr/local/lib/bison.hairy"
 # endif
 #endif
+
+
+/*---------------------------------.
+| Debugging the memory allocator.  |
+`---------------------------------*/
+
+# if WITH_DMALLOC
+#  define DMALLOC_FUNC_CHECK
+#  include <dmalloc.h>
+# endif /* WITH_DMALLOC */
+
+#endif  /* BISON_SYSTEM_H */