From: Dan Nicolaescu Date: Sat, 13 Nov 2010 17:22:52 +0000 (-0500) Subject: Backport fix for Bug#6170 from trunk. X-Git-Tag: emacs-pretest-23.2.91~49^2~33 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4d613e98a7ca89dbebbcc1a2865f8df04bf888f8;p=emacs.git 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). --- diff --git a/ChangeLog b/ChangeLog index 75813c9e7aa..a6b47ed9415 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-13 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-11-08 Stefan Monnier * .dir-locals.el (log-edit-mode): Set log-edit-rewrite-fixes. diff --git a/configure.in b/configure.in index ca68db1b83d..b9e183cad3e 100644 --- a/configure.in +++ b/configure.in @@ -2927,15 +2927,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 4667c0feb28..90098719511 100644 --- a/src/config.in +++ b/src/config.in @@ -1178,15 +1178,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