Skip to content
Permalink
Browse files
Handle macro arguments that contain parentheses, like macro((1+1),2).
 Fixes unit test preprocessor/output/macro-paren-stacking.
  • Loading branch information
icculus committed Apr 9, 2009
1 parent 3991032 commit d4cf9db1eb2e1b654e47a1186f79d7269131366a
Showing with 8 additions and 6 deletions.
  1. +8 −6 mojoshader_preprocessor.c
@@ -1232,14 +1232,16 @@ static int handle_pp_identifier(Context *ctx)
paren++;
else if (t == ')')
{
if (i != def->paramcount-1)
{
fail(ctx, "Too few macro arguments");
goto handle_pp_identifier_failed;
} // if

assert(paren >= 0);
if (paren == 0)
{
if (i != def->paramcount-1)
{
fail(ctx, "Too few macro arguments");
goto handle_pp_identifier_failed;
} // if
break;
} // if

paren--;
} // else if

0 comments on commit d4cf9db

Please sign in to comment.