summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2003-06-14 06:01:35 +0000
committerobrien <obrien@FreeBSD.org>2003-06-14 06:01:35 +0000
commit238bdf53678eb2c192c6a8c5762218996ff68f1a (patch)
tree8b7366e6214edd6406e22b0983c1350b0dca77fa
parenta69cc262ba95c28379581d6814cb6a01c3ffe25e (diff)
downloadFreeBSD-src-238bdf53678eb2c192c6a8c5762218996ff68f1a.zip
FreeBSD-src-238bdf53678eb2c192c6a8c5762218996ff68f1a.tar.gz
Use GCC's internal built-in alloca implementation, when available.
Submitted by: DES
-rw-r--r--sys/sys/cdefs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index ff81fb5..0ecd23c 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -142,6 +142,11 @@
#define __section(x) __attribute__((__section__(x)))
#endif
#endif
+#ifdef __GNUC__
+#define alloca(sz) __builtin_alloca(sz)
+#else
+#error FreeBSD alloca support needed for this compiler
+#endif
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
#if !(__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3)
OpenPOWER on IntegriCloud