summaryrefslogtreecommitdiff
path: root/modules/m4.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2008-03-13 13:48:49 -0600
committerEric Blake <ebb9@byu.net>2008-03-13 21:09:32 -0600
commit2f49d755e50a574e5a772893f3f5d683495084bc (patch)
treee9492b7fcfd6458ca256783f6d09b03f86d06853 /modules/m4.c
parentd621af1bae17e8f6dc2384b71acab9ef21ef51bd (diff)
downloadm4-2f49d755e50a574e5a772893f3f5d683495084bc.tar.gz
Stage 19b: invert sense of bit for handling builtin tokens.
* m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro. (M4_BUILTIN_GROKS_MACRO): Rename... (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense. (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise... (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to this. * m4/m4private.h (VALUE_MACRO_ARGS_BIT) (m4_symbol_value_groks_macro): Likewise... (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to this. * m4/symtab.c (m4_symbol_value_groks_macro): Likewise... (m4_symbol_value_flatten_args): ...to this. * m4/macro.c (collect_arguments): Accomodate changed sense. * m4/module.c (m4__module_open): Require arguments if flattening is requested. * m4/input.c (m4_push_string_finish): For now, flatten all builtins pushed as back-references. * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients. * modules/import.c (m4_builtin_table): Likewise. * modules/load.c (m4_builtin_table): Likewise. * modules/modtest.c (m4_builtin_table): Likewise. * modules/mpeval.c (m4_builtin_table): Likewise. * modules/perl.c (m4_builtin_table): Likewise. * modules/shadow.c (m4_builtin_table): Likewise. * modules/stdlib.c (m4_builtin_table): Likewise. * modules/time.c (m4_builtin_table): Likewise. * modules/m4.c (m4_builtin_table): Likewise. (mkstemp): Undo #undef hack from 2006-10-23, now that macro names are stringized without preprocessor expansion. * doc/m4.texinfo (Defn): Update comments to match reality. (Debuglen): Update test now that user macros pass builtin tokens. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'modules/m4.c')
-rw-r--r--modules/m4.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/modules/m4.c b/modules/m4.c
index f5f07665..ca37befb 100644
--- a/modules/m4.c
+++ b/modules/m4.c
@@ -55,10 +55,6 @@ extern const char *m4_expand_ranges (const char *s, m4_obstack *obs);
extern void m4_make_temp (m4 *context, m4_obstack *obs, const char *macro,
const char *name, size_t len, bool dir);
-/* stdlib--.h defines mkstemp to a safer replacement, but this
- interferes with our preprocessor table of builtin definitions. */
-#undef mkstemp
-
/* Maintain each of the builtins implemented in this modules along
with their details in a single table for easy maintenance.
@@ -121,12 +117,9 @@ static void numb_obstack (m4_obstack *obs, number value,
/* Generate a table for mapping m4 symbol names to handler functions. */
m4_builtin m4_builtin_table[] =
{
-#define BUILTIN(handler, macros, blind, side, min, max) \
- { CONC (builtin_, handler), STR (handler), \
- ((macros ? M4_BUILTIN_GROKS_MACRO : 0) \
- | (blind ? M4_BUILTIN_BLIND : 0) \
- | (side ? M4_BUILTIN_SIDE_EFFECT : 0)), \
- min, max },
+#define BUILTIN(handler, macros, blind, side, min, max) \
+ M4BUILTIN_ENTRY (handler, #handler, macros, blind, side, min, max)
+
builtin_functions
#undef BUILTIN