mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
also use recursive-expansion on macros without parameters
This commit is contained in:
parent
57ac55ad01
commit
0ad2b8b2c7
1 changed files with 5 additions and 5 deletions
10
ftepp.c
10
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;
|
||||
|
|
Loading…
Reference in a new issue