]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Speed up diversion handling.
authorEric Blake <ebb9@byu.net>
Wed, 30 Jul 2008 20:45:42 +0000 (14:45 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 6 Aug 2008 15:56:59 +0000 (09:56 -0600)
* lib/m4sugar/m4sugar.m4 (m4_divert, m4_divert_push)
(m4_divert_pop, m4_divert_text): Avoid dnl for fewer macro
expansions.

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

index ed7a91541e97bb2439c48ee1d7772b691c17e2a5..a00502b05b3b5fafa99c9dfdacda066d6bee1503 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-08-06  Eric Blake  <ebb9@byu.net>
 
+       Speed up diversion handling.
+       * lib/m4sugar/m4sugar.m4 (m4_divert, m4_divert_push)
+       (m4_divert_pop, m4_divert_text): Avoid dnl for fewer macro
+       expansions.
+
        AC_C_CHAR_UNSIGNED is not strictly necessary.
        * doc/autoconf.texi (C Compiler) <AC_C_CHAR_UNSIGNED>: Mention a
        portable alternative to this macro.
index d864f18b70a29ec036ce5ecc193a1cdf998c93ae..450d7a914d0c0bab105ad66e04957cff15eddb18 100644 (file)
@@ -1055,19 +1055,17 @@ _m4_defn([m4_divert_stack])])])
 # -------------------------
 # Change the diversion stream to DIVERSION-NAME.
 m4_define([m4_divert],
-[m4_define([m4_divert_stack], m4_location[: $0: $1]_m4_divert_n_stack)dnl
-m4_builtin([divert], _m4_divert([$1]))dnl
-])
+[m4_define([m4_divert_stack], m4_location[: $0: $1]_m4_divert_n_stack)]dnl
+[m4_builtin([divert], _m4_divert([$1]))])
 
 
 # m4_divert_push(DIVERSION-NAME)
 # ------------------------------
 # Change the diversion stream to DIVERSION-NAME, while stacking old values.
 m4_define([m4_divert_push],
-[m4_pushdef([m4_divert_stack], m4_location[: $0: $1]_m4_divert_n_stack)dnl
-m4_pushdef([_m4_divert_diversion], [$1])dnl
-m4_builtin([divert], _m4_divert([$1]))dnl
-])
+[m4_pushdef([m4_divert_stack], m4_location[: $0: $1]_m4_divert_n_stack)]dnl
+[m4_pushdef([_m4_divert_diversion], [$1])]dnl
+[m4_builtin([divert], _m4_divert([$1]))])
 
 
 # m4_divert_pop([DIVERSION-NAME])
@@ -1077,17 +1075,15 @@ m4_builtin([divert], _m4_divert([$1]))dnl
 # When we pop the last value from the stack, we divert to -1.
 m4_define([m4_divert_pop],
 [m4_ifndef([_m4_divert_diversion],
-          [m4_fatal([too many m4_divert_pop])])dnl
-m4_if([$1], [], [],
-      [$1], m4_defn([_m4_divert_diversion]), [],
-      [m4_fatal([$0($1): diversion mismatch: ]_m4_divert_n_stack)])dnl
-m4_popdef([m4_divert_stack])dnl
-m4_popdef([_m4_divert_diversion])dnl
-m4_builtin([divert],
-          m4_ifdef([_m4_divert_diversion],
-                   [_m4_divert(_m4_defn([_m4_divert_diversion]))],
-                   -1))dnl
-])
+          [m4_fatal([too many m4_divert_pop])])]dnl
+[m4_if([$1], [], [],
+       [$1], _m4_defn([_m4_divert_diversion]), [],
+       [m4_fatal([$0($1): diversion mismatch: ]_m4_divert_n_stack)])]dnl
+[_m4_popdef([m4_divert_stack], [_m4_divert_diversion])]dnl
+[m4_builtin([divert],
+           m4_ifdef([_m4_divert_diversion],
+                    [_m4_divert(_m4_defn([_m4_divert_diversion]))],
+                    -1))])
 
 
 # m4_divert_text(DIVERSION-NAME, CONTENT)
@@ -1095,10 +1091,8 @@ m4_builtin([divert],
 # Output CONTENT into DIVERSION-NAME (which may be a number actually).
 # An end of line is appended for free to CONTENT.
 m4_define([m4_divert_text],
-[m4_divert_push([$1])dnl
-$2
-m4_divert_pop([$1])dnl
-])
+[m4_divert_push([$1])$2
+m4_divert_pop([$1])])
 
 
 # m4_divert_once(DIVERSION-NAME, CONTENT)