summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2010-11-13 12:22:52 -0500
committerChong Yidong <cyd@stupidchicken.com>2010-11-13 12:22:52 -0500
commit206d1d71b32e251c555d142fdbb0ac86afaf8552 (patch)
tree324bf2e7e0d437f3bb5b91b561b147a59de39c6e /configure.in
parenta9eda2cba7388f4ed4b5113db752bda8f641c7b9 (diff)
downloademacs-206d1d71b32e251c555d142fdbb0ac86afaf8552.tar.gz
Backport fix for Bug#6170 from trunk.
Fix alloca definition when using gcc on non-gnu systems. * configure.in: Use the code sequence indicated by "info autoconf" for alloca (bug#6170).
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in22
1 files changed, 13 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index ca68db1b83d..b9e183cad3e 100644
--- a/configure.in
+++ b/configure.in
@@ -2927,15 +2927,19 @@ extern char *getenv ();
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#ifndef __GNUC__
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else /* AIX files deal with #pragma. */
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif /* HAVE_ALLOCA_H */
-#endif /* __GNUC__ */
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
#ifndef HAVE_SIZE_T
typedef unsigned size_t;
#endif