Support crappy compilers and platforms which have problems with alloca.
authordrepper <drepper>
Wed, 14 Jan 2004 04:10:07 +0000 (04:10 +0000)
committerdrepper <drepper>
Wed, 14 Jan 2004 04:10:07 +0000 (04:10 +0000)
posix/regex.c
posix/regex_internal.h

index f18178a..4c38262 100644 (file)
    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 <alloca.h>
+#   else
+#    ifdef __hpux
+        void *alloca ();
+#    else
+#     if !defined __OS2__ && !defined WIN32
+        char *alloca ();
+#     else
+#      include <malloc.h>       /* 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)
index 6cbc48e..7a7d964 100644 (file)
 #ifndef _REGEX_INTERNAL_H
 #define _REGEX_INTERNAL_H 1
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include <assert.h>
 #include <ctype.h>
 #include <limits.h>