[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU Autoconf source repository branch, master, updated. v2.63-98-g
From: |
Eric Blake |
Subject: |
[SCM] GNU Autoconf source repository branch, master, updated. v2.63-98-gb4bb9ca |
Date: |
Fri, 24 Oct 2008 17:52:45 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".
http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=b4bb9caba25dbbbc8576fa907be9ed1dff05652d
The branch, master has been updated
via b4bb9caba25dbbbc8576fa907be9ed1dff05652d (commit)
from d0c5f482d5aa2eb662758921e441d39dd0277531 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b4bb9caba25dbbbc8576fa907be9ed1dff05652d
Author: Eric Blake <address@hidden>
Date: Fri Oct 24 11:24:32 2008 -0600
Make m4_defun_init more robust.
* lib/m4sugar/m4sugar.m4 (m4_defun_init): Handle indirect macro
names, and correct number of arguments.
(m4_copy): Also set up location of the copy.
(m4_defun): When copied, use current macro name, not original.
* tests/m4sugar.at (m4@&address@hidden: one-shot initialization):
Update test.
Signed-off-by: Eric Blake <address@hidden>
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 ++++++++
lib/m4sugar/m4sugar.m4 | 12 +++++++-----
tests/m4sugar.at | 10 +++++++++-
3 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ac48cd9..18ac8e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2008-10-24 Eric Blake <address@hidden>
+ Make m4_defun_init more robust.
+ * lib/m4sugar/m4sugar.m4 (m4_defun_init): Handle indirect macro
+ names, and correct number of arguments.
+ (m4_copy): Also set up location of the copy.
+ (m4_defun): When copied, use current macro name, not original.
+ * tests/m4sugar.at (m4@&address@hidden: one-shot initialization):
+ Update test.
+
Optimize clients of AS_REQUIRE.
* lib/m4sugar/m4sugar.m4 (m4_defun): Add undocumented third
argument.
diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4
index 13a1ddb..22c38e8 100644
--- a/lib/m4sugar/m4sugar.m4
+++ b/lib/m4sugar/m4sugar.m4
@@ -544,7 +544,8 @@ m4_define([_m4_bpatsubsts],
m4_define([m4_copy],
[m4_ifdef([$2], [m4_fatal([$0: won't overwrite defined macro: $2])],
[_$0([$1], [m4_tmp])_$0([m4_tmp], [$2],
- [m4_pushdef([$1], _m4_defn([m4_tmp]))])])])
+ [m4_pushdef([$1], _m4_defn([m4_tmp]))])m4_ifdef([m4_location($1)],
+ [m4_define([m4_location($2)], m4_location)])])])
m4_define([_m4_copy],
[m4_ifdef([$1], [m4_pushdef([$2], _m4_defn([$1]))$3[]_m4_popdef([$1])$0($@)])])
@@ -1662,9 +1663,9 @@ m4_define([m4_divert_require],
# previously m4_define'd definition so that subsequent use of the
# macro is faster.
m4_define([m4_defun],
-[m4_define([m4_location($1)], m4_location)dnl
-m4_default([$3], [m4_define])([$1],
- [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])
+[m4_define([m4_location($1)], m4_location)]dnl
+[m4_default([$3], [m4_define])([$1],
+ [_m4_defun_pro(]m4_dquote($[0])[)$2[]_m4_defun_epi(]m4_dquote($[0])[)])])
# m4_defun_init(NAME, INIT, COMMON)
@@ -1683,7 +1684,8 @@ m4_default([$3], [m4_define])([$1],
# to m4_defun.
m4_define([m4_defun_init],
[m4_define([$1], [$3])m4_defun([$1],
- [$2[]_m4_popdef(]m4_dquote([$][0])[)$][0($][@)], [m4_pushdef])])
+ [$2[]_m4_popdef(]m4_dquote($[0])[)m4_indir(]m4_dquote($[0])dnl
+[m4_if(]m4_dquote($[#])[, [0], [], ]m4_dquote([,$]@)[))], [m4_pushdef])])
# m4_defun_once(NAME, EXPANSION)
diff --git a/tests/m4sugar.at b/tests/m4sugar.at
index cfaed3b..959b209 100644
--- a/tests/m4sugar.at
+++ b/tests/m4sugar.at
@@ -200,7 +200,7 @@ AT_CLEANUP
## ---------------------- ##
AT_SETUP([m4@&address@hidden: one-shot initialization])
-AT_KEYWORDS([m4@&address@hidden)
+AT_KEYWORDS([m4@&address@hidden m4@&address@hidden)
AT_CHECK_M4SUGAR_TEXT([[
m4_defun_init([a], [[init a
@@ -210,12 +210,20 @@ m4_defun([c], [[c]m4_require([a])])dnl
b
c
a
+m4_defun_init([-], [hello, ], [m4_if([$#], [0], [world], [[$1]])])dnl
+m4_copy([-], [.])dnl
+m4_indir([.])
+m4_indir([.], [goodbye])
+m4_indir([-], [again])
]], [[
init a
common a
b
c
common a
+hello, world
+goodbye
+hello, again
]])
AT_CLEANUP
hooks/post-receive
--
GNU Autoconf source repository
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU Autoconf source repository branch, master, updated. v2.63-98-gb4bb9ca,
Eric Blake <=