m4: allow the definition of side-effect only macros

* data/bison.m4 (b4_divert_kill, b4_define_silent): New.
* data/c.m4: Comment change.
This commit is contained in:
Akim Demaille
2013-04-08 20:37:09 +02:00
parent 6155db81aa
commit dde95ca432
2 changed files with 15 additions and 1 deletions

View File

@@ -85,6 +85,20 @@ m4_changecom([#])
])
# b4_divert_kill(CODE)
# --------------------
# Expand CODE for its side effects, discard its output.
m4_define([b4_divert_kill],
[m4_divert_text([KILL], [$1])])
# b4_define_silent(MACRO, CODE)
# -----------------------------
# Same as m4_define, but throw away the expansion of CODE.
m4_define([b4_define_silent],
[m4_define([$1], [b4_divert_kill([$2])])])
## ---------------- ##
## Error handling. ##
## ---------------- ##

View File

@@ -549,7 +549,7 @@ b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval;
# b4_YYDEBUG_define
# ------------------
# -----------------
m4_define([b4_YYDEBUG_define],
[[/* Debug traces. */
]m4_if(b4_api_prefix, [yy],