changeset 13367:df004f9880d2

regex: Don't require alloca.
author Bruno Haible <bruno@clisp.org>
date Mon, 24 May 2010 12:23:03 +0200
parents 8c0d5f7896a2
children ad29a61a81b9
files ChangeLog lib/regex_internal.h modules/regex
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-24  Bruno Haible  <bruno@clisp.org>
+
+	regex: Don't require alloca.
+	* modules/regex (Depends-on): Remove alloca. Add alloca-opt.
+	* lib/regex_internal.h (alloca): Ensure it's defined even if we call it
+	only inside if (0).
+
 2010-05-23  Jim Meyering  <meyering@redhat.com>
 
 	test-renameat.c: include <sys/stat.h>
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -467,6 +467,8 @@
 # else
 /* alloca is implemented with malloc, so just use malloc.  */
 #  define __libc_use_alloca(n) 0
+#  undef alloca
+#  define alloca(n) malloc (n)
 # endif
 #endif
 
--- a/modules/regex
+++ b/modules/regex
@@ -12,7 +12,7 @@
 m4/mbstate_t.m4
 
 Depends-on:
-alloca
+alloca-opt
 btowc
 extensions
 gettext-h