From: <pro...@th...> - 2001-12-20 01:48:49
|
On Mon, Dec 17, 2001 at 01:24:23PM +0100, agr...@do... wrote: > all versions of solaris2 (i checked 2.4 through 8) > require you to to include alloca.h when using alloca, > otherwise compilation fails. > this is also specified in the manpage. > i used "cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15". > after adding this, compilation worked fine. The patch below is better as it works on AIX as well. We've already submitted this to the BTS. -- albert chin (ch...@th...) -- snip snip --- lib/glibc-glob.c.orig Tue Oct 23 11:17:46 2001 +++ lib/glibc-glob.c Tue Oct 23 11:18:14 2001 @@ -21,12 +21,20 @@ #pragma alloca #endif -/* HPUX10 & HPUX11 need this */ -#if defined(HPUX10) || defined(HPUX11) - #include <alloca.h> -#endif - #include <config.h> + +/* Make alloca work the best possible way. */ +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not __GNUC__ */ +#if HAVE_ALLOCA_H +#include <alloca.h> +#else /* not __GNUC__ or HAVE_ALLOCA_H */ +#ifndef _AIX /* Already did AIX, up at the top. */ +char *alloca (); +#endif /* not _AIX */ +#endif /* not HAVE_ALLOCA_H */ +#endif /* not __GNUC__ */ #define MAX_RECURSION 8 #define MAX_RESULTS 100000UL |