From a5d1a763609047d168282a5d0f5d9e803d9e3ba2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 12 Mar 2010 10:35:37 -0500 Subject: [PATCH] Don't replace macros with args until later in preprocessing. Fixes unit_tests/preprocessor/output/macro-with-arg-as-macro-arg ... --- mojoshader_preprocessor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index 0110afc5..08794f38 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -1503,7 +1503,8 @@ static int handle_macro_args(Context *ctx, const char *sym, const Define *def) else if (t == TOKEN_IDENTIFIER) { const Define *def = find_define_by_token(ctx); - if (def) + // don't replace macros with arguments so they replace correctly, later. + if ((def) && (def->paramcount == 0)) { expr = def->definition; exprlen = strlen(def->definition);