changeset 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 2529e302a86e
children 31f67bce5645
files ChangeLog configure.in src/config.in
diffstat 3 files changed, 32 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Nov 13 11:08:21 2010 +0100
+++ b/ChangeLog	Sat Nov 13 12:22:52 2010 -0500
@@ -1,3 +1,9 @@
+2010-11-13  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Fix alloca definition when using gcc on non-gnu systems.
+	* configure.in: Use the code sequence indicated by "info autoconf"
+	for alloca (bug#6170).
+
 2010-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* .dir-locals.el (log-edit-mode): Set log-edit-rewrite-fixes.
--- 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
--- a/src/config.in	Sat Nov 13 11:08:21 2010 +0100
+++ b/src/config.in	Sat Nov 13 12:22:52 2010 -0500
@@ -1178,15 +1178,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