From 8923d6176b785c2d800d27960d55a7dec3fed71b Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Tue, 1 Jun 2010 19:32:43 -0700 Subject: [PATCH] Fix alloca definition when using gcc on non-gnu systems. * configure.in: Use the code sequence indicated by "info autoconf" for alloca (bug#6170). --- ChangeLog | 6 ++++++ configure.in | 22 +++++++++++++--------- src/config.in | 22 +++++++++++++--------- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b0432f679f..9d2fe0b233c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-06-02 Dan Nicolaescu + + 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 * .bzrignore: Ignore new files from trunk, which appear if you use diff --git a/configure.in b/configure.in index 9694a91739f..2e31641f25f 100644 --- a/configure.in +++ b/configure.in @@ -3604,15 +3604,19 @@ extern char *getenv (); #ifdef HAVE_STDLIB_H #include #endif -#ifndef __GNUC__ -# ifdef HAVE_ALLOCA_H -# include -# 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 +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +#endif #ifndef HAVE_SIZE_T typedef unsigned size_t; #endif diff --git a/src/config.in b/src/config.in index 9d845027db4..16d788fd7a2 100644 --- a/src/config.in +++ b/src/config.in @@ -1164,15 +1164,19 @@ extern char *getenv (); #ifdef HAVE_STDLIB_H #include #endif -#ifndef __GNUC__ -# ifdef HAVE_ALLOCA_H -# include -# 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 +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +#endif #ifndef HAVE_SIZE_T typedef unsigned size_t; #endif -- 2.39.2