From 82e2ba9a036d0a8a01344271ebd2db69f3b20cc7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 14 Jan 2004 04:11:30 +0000 Subject: Update. 2004-01-13 Ulrich Drepper * posix/regex.c: Support crappy compilers and platforms which have problems with alloca. * posix/regex_internal.h: Likewise. Patch by Paolo Bonzini. --- posix/regex.c | 28 ++++++++++++++++++++++++++++ posix/regex_internal.h | 4 ---- 2 files changed, 28 insertions(+), 4 deletions(-) (limited to 'posix') diff --git a/posix/regex.c b/posix/regex.c index f18178a479..4c3826238b 100644 --- a/posix/regex.c +++ b/posix/regex.c @@ -18,6 +18,34 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef _AIX +#pragma alloca +#else +# ifndef allocax /* predefined by HP cc +Olibcalls */ +# ifdef __GNUC__ +# define alloca(size) __builtin_alloca (size) +# else +# if HAVE_ALLOCA_H +# include +# else +# ifdef __hpux + void *alloca (); +# else +# if !defined __OS2__ && !defined WIN32 + char *alloca (); +# else +# include /* OS/2 defines alloca in here */ +# endif +# endif +# endif +# endif +# endif +#endif + #ifdef _LIBC /* We have to keep the namespace clean. */ # define regfree(preg) __regfree (preg) diff --git a/posix/regex_internal.h b/posix/regex_internal.h index 6cbc48eee5..7a7d964bd5 100644 --- a/posix/regex_internal.h +++ b/posix/regex_internal.h @@ -21,10 +21,6 @@ #ifndef _REGEX_INTERNAL_H #define _REGEX_INTERNAL_H 1 -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #include -- cgit v1.2.3