Fix alloca definition when using gcc on non-gnu systems.
authorDan Nicolaescu <dann@ics.uci.edu>
Wed, 2 Jun 2010 02:32:43 +0000 (19:32 -0700)
committerDan Nicolaescu <dann@ics.uci.edu>
Wed, 2 Jun 2010 02:32:43 +0000 (19:32 -0700)
* configure.in: Use the code sequence indicated by "info autoconf"
for alloca (bug#6170).

ChangeLog
configure.in
src/config.in

index 5b0432f..9d2fe0b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-06-02  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-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * .bzrignore: Ignore new files from trunk, which appear if you use
index 9694a91..2e31641 100644 (file)
@@ -3604,15 +3604,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
index 9d84502..16d788f 100644 (file)
@@ -1164,15 +1164,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