-
-# include "xalloc.h"
-
-/* From xstrndup.c. */
-char *xstrndup (const char *s, size_t n);
-
-
-/*----------------.
-| Using timevar. |
-`----------------*/
-
-#include "timevar.h"
-extern int time_report;
-
-
-/*---------------------.
-| Missing prototypes. |
-`---------------------*/
-
-#if !HAVE_DECL_STPCPY
-char *stpcpy (char *dest, const char *src);
-#endif
-
-#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);
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
+#define STREQ(L, R) (strcmp(L, R) == 0)
+#define STRNEQ(L, R) (!STREQ(L, R))
+
+/* Just like strncmp, but the second argument must be a literal string
+ and you don't specify the length. */
+#define STRNCMP_LIT(S, Literal) \
+ strncmp (S, "" Literal "", sizeof (Literal) - 1)
+
+/* Whether Literal is a prefix of S. */
+#define STRPREFIX_LIT(Literal, S) \
+ (STRNCMP_LIT (S, Literal) == 0)
+
+#include <unistd.h>
+#include <inttypes.h>
+
+#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
+#define STREQ(L, R) (strcmp(L, R) == 0)
+#define STRNEQ(L, R) (!STREQ(L, R))
+
+#ifndef UINTPTR_MAX
+/* This isn't perfect, but it's good enough for Bison, which needs
+ only to hash pointers. */
+typedef size_t uintptr_t;