From 0ad2b8b2c7a7fff3d32afe31de0d23400ed3a615 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 16 Nov 2012 22:38:58 +0100 Subject: [PATCH] also use recursive-expansion on macros without parameters --- ftepp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ftepp.c b/ftepp.c index 3e890e2..cdc0d1e 100644 --- a/ftepp.c +++ b/ftepp.c @@ -444,6 +444,7 @@ static bool ftepp_macro_expand(ftepp_t *ftepp, ppmacro *macro, macroparam *param } vec_push(ftepp->output, 0); /* Now run the preprocessor recursively on this string buffer */ + printf("__________\n%s\n=========\n", ftepp->output); inlex = lex_open_string(ftepp->output, vec_size(ftepp->output)-1, ftepp->lex->name); if (!inlex) { ftepp_error(ftepp, "internal error: failed to instantiate lexer"); @@ -471,14 +472,13 @@ static bool ftepp_macro_call(ftepp_t *ftepp, ppmacro *macro) macroparam *params = NULL; bool retval = true; - ftepp_next(ftepp); - if (!macro->has_params) { - for (o = 0; o < vec_size(macro->output); ++o) { - ftepp_out(ftepp, macro->output[o]->value, false); - } + if (!ftepp_macro_expand(ftepp, macro, NULL)) + return false; + ftepp_next(ftepp); return true; } + ftepp_next(ftepp); if (!ftepp_skipallwhite(ftepp)) return false; -- 2.39.2