From a0ceceba5de4032d0876c9aa6914917ee7ac1cc7 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Fri, 21 Jul 2006 00:32:32 +0000 Subject: [PATCH] (alloca): Update etc blob, per current autoconf recommendation. Should fix Solaris 10 reported by Claes Wallin. --- libguile/eval.c | 32 +++++++++++++++----------------- libguile/filesys.c | 32 +++++++++++++++----------------- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/libguile/eval.c b/libguile/eval.c index 9fe419137..ce490aa93 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -37,24 +37,22 @@ #ifndef DEVAL -/* AIX requires this to be the first thing in the file. The #pragma - directive is indented so pre-ANSI compilers will ignore it, rather - than choke on it. */ -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX -# pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif +/* This blob per the Autoconf manual (under "Particular Functions"). */ +#if HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +# ifdef __cplusplus +extern "C" # endif -#endif -#if HAVE_MALLOC_H -#include /* alloca on mingw */ +void *alloca (size_t); #endif #include diff --git a/libguile/filesys.c b/libguile/filesys.c index 8ac6bd246..f923261f0 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -29,24 +29,22 @@ # include #endif -/* AIX requires this to be the first thing in the file. The #pragma - directive is indented so pre-ANSI compilers will ignore it, rather - than choke on it. */ -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX -# pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif +/* This blob per the Autoconf manual (under "Particular Functions"). */ +#if HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +# ifdef __cplusplus +extern "C" # endif -#endif -#if HAVE_MALLOC_H -#include /* alloca on mingw, though its not used on that system */ +void *alloca (size_t); #endif #include