]> git.saurik.com Git - bison.git/blobdiff - src/system.h
* acconfig.h: Remove, no longer used.
[bison.git] / src / system.h
index ae02b6199829f3d96a98aa552604fcbe1516baef..797ae545becc73eadda568bbc92f4f963706a192 100644 (file)
@@ -1,5 +1,5 @@
 /* system-dependent definitions for Bison.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright 2000 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -24,6 +24,8 @@
 
 #include <stdio.h>
 
+#include <assert.h>
+
 #ifdef MSDOS
 # include <io.h>
 #endif
@@ -159,3 +161,36 @@ extern int errno;
 # define FALSE (0)
 #endif
 typedef int bool;
+
+
+/*-----------.
+| Obstacks.  |
+`-----------*/
+
+#define obstack_chunk_alloc xmalloc
+#define obstack_chunk_free  free
+#include "obstack.h"
+
+#define obstack_grow_literal_string(Obs, Str) \
+  obstack_grow (Obs, Str, sizeof (Str) - 1)
+
+#define obstack_fgrow1(Obs, Format, Arg1)      \
+do {                                           \
+  char buf[4096];                              \
+  sprintf (buf, Format, Arg1);                 \
+  obstack_grow (Obs, buf, strlen (buf));       \
+} while (0)
+
+#define obstack_fgrow2(Obs, Format, Arg1, Arg2)        \
+do {                                           \
+  char buf[4096];                              \
+  sprintf (buf, Format, Arg1, Arg2);           \
+  obstack_grow (Obs, buf, strlen (buf));       \
+} while (0)
+
+#define obstack_fgrow3(Obs, Format, Arg1, Arg2, Arg3)  \
+do {                                                   \
+  char buf[4096];                                      \
+  sprintf (buf, Format, Arg1, Arg2, Arg3);             \
+  obstack_grow (Obs, buf, strlen (buf));               \
+} while (0)