From 979f8ed7f0a78f057756d70b96f843821d4eb911 Mon Sep 17 00:00:00 2001 From: hniksic Date: Sat, 25 Jun 2005 18:56:29 -0700 Subject: [PATCH] [svn] Update alloca declaration. --- src/ChangeLog | 6 ++++++ src/config-post.h | 40 +++++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8388a998..5b16ee3b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-06-26 Hrvoje Niksic + + * config-post.h: Replace the alloca declaration with the one from + the latest Autoconf manual. This should remove a warning with GCC + on AIX. + 2005-06-26 Hrvoje Niksic * ftp.c (getftp): Always invoke SIZE, not only when continuing a diff --git a/src/config-post.h b/src/config-post.h index 04de0b7d..ed69cf81 100644 --- a/src/config-post.h +++ b/src/config-post.h @@ -6,23 +6,7 @@ This file is included at the bottom of config.h. */ -/* Alloca-related defines, straight out of the Autoconf manual. */ - -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (); -# endif -# endif -# endif -#endif - +/* Testing for __sun is not enough because it's also defined on SunOS. */ #ifdef __sun # ifdef __SVR4 # define solaris @@ -64,3 +48,25 @@ void *alloca (); #define _BSD_SOURCE #endif /* NAMESPACE_TWEAKS */ + + +/* Alloca-related defines, straight out of the Autoconf manual. These + have to be after the above namespace tweaks, but before actual + declarations and system includes. */ + +#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 +void *alloca (size_t); +#endif -- 2.39.2