aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2001-03-06 18:27:14 +0000
committerDJ Delorie <dj@redhat.com>2001-03-06 18:27:14 +0000
commit30673bf5116aafb5896d9f58010595e6c0e45e47 (patch)
treeb2cc84ad403c354f45353002fab03a39abc583c4 /include
parentb6ba6518e9254bc25f88088228e93ac966ebccd1 (diff)
downloadfsf-binutils-gdb-30673bf5116aafb5896d9f58010595e6c0e45e47.zip
fsf-binutils-gdb-30673bf5116aafb5896d9f58010595e6c0e45e47.tar.gz
fsf-binutils-gdb-30673bf5116aafb5896d9f58010595e6c0e45e47.tar.bz2
merge from gcc
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog5
-rw-r--r--include/libiberty.h14
2 files changed, 19 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 8eb61e6..21ce684 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2001-03-06 Zack Weinberg <zackw@stanford.edu>
+
+ * libiberty.h: Prototype C_alloca; define alloca to either
+ __builtin_alloca or C_alloca as appropriate.
+
2001-03-01 John David Anglin <dave@hiauly1.hia.nrc.ca>
* safe-ctype.h (_sch_test): Cast enum bit to unsigned short int for pcc
diff --git a/include/libiberty.h b/include/libiberty.h
index 64d072b..e4fc2af 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -206,6 +206,20 @@ extern int vasprintf PARAMS ((char **, const char *, va_list))
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
+/* 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. */
+extern PTR C_alloca PARAMS((size_t));
+#undef alloca
+#if GCC_VERSION >= 2000 && !defined USE_C_ALLOCA
+# define alloca(x) __builtin_alloca(x)
+#else
+# define alloca(x) C_alloca(x)
+# undef USE_C_ALLOCA
+# define USE_C_ALLOCA 1
+#endif
+
#ifdef __cplusplus
}
#endif