autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fix last weekend's regressions in AC_DEFINE


From: Eric Blake
Subject: fix last weekend's regressions in AC_DEFINE
Date: Mon, 1 Oct 2007 16:12:18 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Sorry for the breakage; and at least the AC_F77_WRAPPERS caught it.

From: Eric Blake <address@hidden>
Date: Mon, 1 Oct 2007 10:10:42 -0600
Subject: [PATCH] Fix regression in AC_DEFINE([macro(with_arg)]).

* lib/autoconf/general.m4 (AC_DEFINE_TRACE): Don't chop off close
quotes with a careless m4_substr.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog               |    6 ++++++
 lib/autoconf/general.m4 |    7 ++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cfe81ea..1e09201 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-01  Eric Blake  <address@hidden>
+
+       Fix regression in AC_DEFINE([macro(with_arg)]).
+       * lib/autoconf/general.m4 (AC_DEFINE_TRACE): Don't chop off close
+       quotes with a careless m4_substr.
+
 2007-09-30  Eric Blake  <address@hidden>
 
        Allow nameless iteration.
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 7835f24..ecbbe99 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2008,11 +2008,12 @@ m4_bmatch([$1], ^m4_defn([m4_re_word])$, [],
 # This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters
 # out non literal symbols.
 #
-# m4_index is roughly 5 to 8 times faster than m4_bpatsubst.
+# m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so only
+# use the regex when necessary.
 m4_define([AC_DEFINE_TRACE],
 [AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL(
-  m4_if(m4_index([[$1]], [(]), [-1], [[$1]],
-       [m4_substr([[$1]], [0], m4_index([[$1]], [(]))]))])])
+  m4_if(m4_index([$1], [(]), [-1], [[$1]],
+       [m4_bpatsubst([[$1]], [(.*)])]))])])
 
 
 # AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
-- 
1.5.3.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]