* alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Dec 2004 13:41:34 +0000 (13:41 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Dec 2004 13:41:34 +0000 (13:41 +0000)
Remove now-obsolete comment about AIX.
* getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
(YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
(YYMAXDEPTH): New macro.

lib/ChangeLog
lib/alloca_.h
lib/getdate.y

index 6601ce55d247ba89464faa56c0f8d70a6c2543fb..762e3ebd4243e9ac448ace980f4c956c036c3f85 100644 (file)
@@ -1,3 +1,11 @@
+2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
+       Remove now-obsolete comment about AIX.
+       * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
+       (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
+       (YYMAXDEPTH): New macro.
+
 2004-12-18  Bruno Haible  <bruno@clisp.org>
 
        * fatal-signal.c (fatal_signals): Make non-const.
index 10995510e25203bfdb75c3f1db0b70e5c9c0d6b7..799037ce0943287d1106fe3025660100fc1e3cba 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
    USA.  */
 
-/* When this file is included, it may be preceded only by preprocessor
-   declarations.  Thanks to AIX.  Therefore we include it right after
-   "config.h", not later.  */
-
-#ifndef _ALLOCA_H
-# define _ALLOCA_H
+/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
+   means there is a real alloca function.  */
+#ifndef _GNULIB_ALLOCA_H
+# define _GNULIB_ALLOCA_H
 
 /* alloca (N) returns a pointer to N bytes of memory
    allocated on the stack, which will last until the function returns.
@@ -51,4 +49,4 @@ extern "C"
 void *alloca (size_t);
 #endif
 
-#endif /* _ALLOCA_H */
+#endif /* _GNULIB_ALLOCA_H */
index 6ffee30b96ffb5a96162c45b69c6f44fca3cffb6..b57e6a56d3a2275be798ed4704e5372e42546134 100644 (file)
 
 #include "getdate.h"
 
-#include <alloca.h>
+/* Use alloca only if it is known to be builtin.  */
+#if HAVE_ALLOCA
+# include <alloca.h>
+#else
+# define YYSTACK_USE_ALLOCA 0
+#endif
+
+/* Tell Bison ow much stack space is needed.  20 should be plenty for
+   this grammar, which is not right recursive.  Beware setting it too
+   high, since that might cause problems on machines whose alloca
+   implementations have lame stack-overflow checking.  */
+#define YYMAXDEPTH 20
 
 /* Since the code of getdate.y is not included in the Emacs executable
    itself, there is no need to #define static in this file.  Even if