From 62c4328e008dd6dd68fb5ac2a7ed1b8790f81279 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 21 Sep 2005 20:08:38 +0000 Subject: [PATCH] Don't rely on whether alloc is #defined; that is in the user's name spac. --- ChangeLog | 3 +-- data/yacc.c | 2 +- tests/torture.at | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2da9f87..49c6d26c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,8 +7,7 @@ * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER && - (defined alloca || defined _ALLOCA_H)]: Don't include ; - not needed in this case. + defined _ALLOCA_H]: Don't include ; not needed in this case. * tests/torture.at (Exploding the Stack Size with Alloca): Adjust to match yacc.c, to test more hosts. diff --git a/data/yacc.c b/data/yacc.c index 9cb7f2f3..b06837c0 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -263,7 +263,7 @@ b4_syncline([@oline@], [@ofile@])[ # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if (! defined (alloca) && ! defined (_ALLOCA_H) && ! defined (_STDLIB_H) \ +# if (! defined (_ALLOCA_H) && ! defined (_STDLIB_H) \ && (defined (__STDC__) || defined (__cplusplus))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H diff --git a/tests/torture.at b/tests/torture.at index e0d8087a..b35052fc 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -445,7 +445,7 @@ AT_SETUP([Exploding the Stack Size with Alloca]) AT_DATA_STACK_TORTURE([[ #if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \ - || defined _AIX || defined _MSC_VER || defined alloca || defined _ALLOCA_H) + || defined _AIX || defined _MSC_VER || defined _ALLOCA_H) # define YYSTACK_USE_ALLOCA 1 #endif ]]) -- 2.45.2