diff configure.in @ 111613:8a76f3e33a5a

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).
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 13 Nov 2010 12:22:52 -0500
parents da3121d12212
children 75b974985fca
line wrap: on
line diff
--- a/configure.in	Sat Nov 13 11:08:21 2010 +0100
+++ b/configure.in	Sat Nov 13 12:22:52 2010 -0500
@@ -2927,15 +2927,19 @@
 #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