aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-03-31 18:59:56 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-03-31 18:59:56 +0000
commitcc56c744ee7845abff3f9be366c09616cdbb6f83 (patch)
tree68ea74209b9d94ef6a9ffafe09d4fb89a5bfce2e
parent7656d28aed3bb0d61a9eff78a43475f47e53376f (diff)
downloadgcc-cc56c744ee7845abff3f9be366c09616cdbb6f83.zip
gcc-cc56c744ee7845abff3f9be366c09616cdbb6f83.tar.gz
gcc-cc56c744ee7845abff3f9be366c09616cdbb6f83.tar.bz2
* libiberty.h (alloca): Handle setting C_ALLOCA.
From-SVN: r40978
-rw-r--r--include/ChangeLog4
-rw-r--r--include/libiberty.h7
2 files changed, 10 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 1c969ff..9334281 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2001-03-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libiberty.h (alloca): Handle setting C_ALLOCA.
+
2001-03-20 Jim Blandy <jimb@redhat.com>
* demangle.h (enum gnu_v3_constructor_kinds,
diff --git a/include/libiberty.h b/include/libiberty.h
index c7a4d06..effe5f6 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -238,15 +238,20 @@ extern int vasprintf PARAMS ((char **, const char *, va_list))
/* Drastically simplified alloca configurator. If we're using GCC,
we use __builtin_alloca; otherwise we use the C alloca. The C
alloca is always available. You can override GCC by defining
- USE_C_ALLOCA yourself. */
+ USE_C_ALLOCA yourself. The canonical autoconf macro C_ALLOCA is
+ also set/unset as it is often used to indicate whether code needs
+ to call alloca(0). */
extern PTR C_alloca PARAMS((size_t));
#undef alloca
#if GCC_VERSION >= 2000 && !defined USE_C_ALLOCA
# define alloca(x) __builtin_alloca(x)
+# undef C_ALLOCA
#else
# define alloca(x) C_alloca(x)
# undef USE_C_ALLOCA
# define USE_C_ALLOCA 1
+# undef C_ALLOCA
+# define C_ALLOCA 1
#endif
#ifdef __cplusplus