]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix m4_set speed regression introduced 2008-12-18.
authorEric Blake <ebb9@byu.net>
Thu, 12 Feb 2009 15:27:18 +0000 (08:27 -0700)
committerEric Blake <ebb9@byu.net>
Thu, 12 Feb 2009 15:27:18 +0000 (08:27 -0700)
* lib/m4sugar/m4sugar.m4 (_m4_stack_reverse): Alter API to avoid
creating larger argument on each iteration.
(m4_stack_foreach_sep, m4_stack_foreach_sep_lifo)
(_m4_set_contents_2): Adjust all four-argument callers.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/m4sugar/m4sugar.m4

index c72253ab0a28fb2a304acbff4c8758127a7d4e04..90f8cd8198407d9614e0bda8b9547bbb01bb56c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-12  Eric Blake  <ebb9@byu.net>
+
+       Fix m4_set speed regression introduced 2008-12-18.
+       * lib/m4sugar/m4sugar.m4 (_m4_stack_reverse): Alter API to avoid
+       creating larger argument on each iteration.
+       (m4_stack_foreach_sep, m4_stack_foreach_sep_lifo)
+       (_m4_set_contents_2): Adjust all four-argument callers.
+
 2009-02-05  Eric Blake  <ebb9@byu.net>
 
        Mention new AC_DEFUN_ONCE clients.
index 55dc6446f79871eb59cb0cae8931ee9c342d9f0f..8356d08223a84dc806d2b93fb76c9eb9713c8d8a 100644 (file)
@@ -1295,10 +1295,10 @@ m4_define([m4_stack_foreach_lifo],
 # is equivalent to m4_stack_foreach_sep([a], [b(], [)]).
 m4_define([m4_stack_foreach_sep],
 [_m4_stack_reverse([$1], [m4_tmp-$1])]dnl
-[_m4_stack_reverse([m4_tmp-$1], [$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4])])
+[_m4_stack_reverse([m4_tmp-$1], [$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4[]])])
 
 m4_define([m4_stack_foreach_sep_lifo],
-[_m4_stack_reverse([$1], [m4_tmp-$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4])]dnl
+[_m4_stack_reverse([$1], [m4_tmp-$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4[]])]dnl
 [_m4_stack_reverse([m4_tmp-$1], [$1])])
 
 
@@ -1307,15 +1307,16 @@ m4_define([m4_stack_foreach_sep_lifo],
 # A recursive worker for pushdef stack manipulation.  Destructively
 # copy the OLD stack into the NEW, and expanding ACTION for each
 # iteration.  After the first iteration, SEP is promoted to the front
-# of ACTION.  The current definition is examined after the NEW has
-# been pushed but before OLD has been popped; this order is important,
-# as ACTION is permitted to operate on either _m4_defn([OLD]) or
-# _m4_defn([NEW]).  Since the operation is destructive, this macro is
-# generally used twice, with a temporary macro name holding the
-# swapped copy.
+# of ACTION (note that SEP should include a trailing [] if it is to
+# avoid interfering with ACTION).  The current definition is examined
+# after the NEW has been pushed but before OLD has been popped; this
+# order is important, as ACTION is permitted to operate on either
+# _m4_defn([OLD]) or _m4_defn([NEW]).  Since the operation is
+# destructive, this macro is generally used twice, with a temporary
+# macro name holding the swapped copy.
 m4_define([_m4_stack_reverse],
 [m4_ifdef([$1], [m4_pushdef([$2],
-  _m4_defn([$1]))$3[]_m4_popdef([$1])$0([$1], [$2], [$4[]$3])])])
+  _m4_defn([$1]))$3[]_m4_popdef([$1])$0([$1], [$2], [$4$3])])])
 
 
 
@@ -2955,7 +2956,7 @@ m4_define([_m4_set_contents_1c],
 
 m4_define([_m4_set_contents_2],
 [_m4_stack_reverse([_m4_set_($1)], [_m4_set([$1])],
-  [$2[]_m4_defn([_m4_set_($1)])$3], [$4])])
+  [$2[]_m4_defn([_m4_set_($1)])$3], [$4[]])])
 
 # m4_set_delete(SET)
 # ------------------