]> Savannah Git Hosting - gnulib.git/commitdiff
regex: support Gawk, which never uses alloca
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Jan 2013 00:05:43 +0000 (16:05 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Jan 2013 00:35:11 +0000 (16:35 -0800)
* lib/regex_internal.h [!_LIBC && !HAVE_ALLOCA]:
Do not include in this case.  Gawk doesn't supply a substitute
alloca.h and doesn't need one.

ChangeLog
lib/regex_internal.h

index cab9521474d95de5acbfaca7a42e2c857aabb9df..cbbc5b43fcc2b554b18e0288de2138a7064ec7d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2013-01-01  Paul Eggert  <eggert@cs.ucla.edu>
 
+       regex: support Gawk, which never uses alloca
+       * lib/regex_internal.h [!_LIBC && !HAVE_ALLOCA]:
+       Do not include in this case.  Gawk doesn't supply a substitute
+       alloca.h and doesn't need one.
+
        regex: port __libc_lock_define usage to C89
        * lib/regex_internal.h (__libc_lock_define) [!_LIBC]: Remove.
        (struct re_dfa_t): Use #ifdef instead.  '__libc_lock_define (, lock)'
index 43fae40eeba5d61cc69e8d59efb71025ad970d60..fa9338256295e28b8be61f4004461cac8f98f257 100644 (file)
@@ -445,7 +445,9 @@ static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
 #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
 #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
 
-#include <alloca.h>
+#if defined _LIBC || HAVE_ALLOCA
+# include <alloca.h>
+#endif
 
 #ifndef _LIBC
 # if HAVE_ALLOCA