# 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
# define PARAMS(p) ()
#endif
-
+# include "xalloc.h"
/*---------------------.
| Missing prototypes. |
# 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
# define LOCALEDIR "/usr/local/share/locale"
#endif
-#endif /* BISON_SYSTEM_H */
-
/*-----------.
| Booleans. |
| 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))
# define BISON_HAIRY "c:/usr/local/lib/bison.hairy"
# endif
#endif
+
+
+/* As memcpy, but for shorts. */
+#define shortcpy(Dest, Src, Num) \
+ memcpy (Dest, Src, Num * sizeof (short))
+
+/* Free a linked list. */
+#define LIST_FREE(Type, List) \
+do { \
+ Type *_node, *_next; \
+ for (_node = List; _node; _node = _next) \
+ { \
+ _next = _node->next; \
+ XFREE (_node); \
+ } \
+} while (0)
+
+/*---------------------------------.
+| Debugging the memory allocator. |
+`---------------------------------*/
+
+# if WITH_DMALLOC
+# define DMALLOC_FUNC_CHECK
+# include <dmalloc.h>
+# endif /* WITH_DMALLOC */
+
+#endif /* BISON_SYSTEM_H */