# HG changeset patch # User Dan Nicolaescu # Date 1275445963 25200 # Node ID 8fccefed04acdad029f6a38d38c5919dc5cfffea # Parent b31557c10743e66c4342250e12439e694e4edbdf Fix alloca definition when using gcc on non-gnu systems. * configure.in: Use the code sequence indicated by "info autoconf" for alloca (bug#6170). diff -r b31557c10743 -r 8fccefed04ac ChangeLog --- a/ChangeLog Wed Jun 02 00:11:49 2010 +0000 +++ b/ChangeLog Tue Jun 01 19:32:43 2010 -0700 @@ -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 -r b31557c10743 -r 8fccefed04ac configure.in --- a/configure.in Wed Jun 02 00:11:49 2010 +0000 +++ b/configure.in Tue Jun 01 19:32:43 2010 -0700 @@ -3604,15 +3604,19 @@ #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 -r b31557c10743 -r 8fccefed04ac src/config.in --- a/src/config.in Wed Jun 02 00:11:49 2010 +0000 +++ b/src/config.in Tue Jun 01 19:32:43 2010 -0700 @@ -1164,15 +1164,19 @@ #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