Skip to content
Snippets Groups Projects
Commit 3a235b57 authored by Elizabeth Figura's avatar Elizabeth Figura Committed by Alexandre Julliard
Browse files

vkd3d-shader/preproc: Expand macro arguments in macro invocations.

parent 9b984891
No related branches found
No related tags found
1 merge request!291vkd3d-shader/preproc: Various fixes.
......@@ -634,6 +634,26 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
switch (token)
{
/* Most text gets left alone (e.g. if it contains macros,
* the macros should be evaluated later).
* Arguments are a special case, and are replaced with
* their values immediately. */
case T_IDENTIFIER:
case T_IDENTIFIER_PAREN:
{
const struct preproc_text *expansion;
if ((expansion = find_arg_expansion(ctx, text)))
{
preproc_push_expansion(ctx, expansion, NULL);
continue;
}
if (current_arg)
preproc_text_add(current_arg, text);
break;
}
case T_NEWLINE:
if (current_arg)
preproc_text_add(current_arg, " ");
......
......@@ -305,3 +305,9 @@ __LINE__
[preproc]
#define KEY pass
apple # KEY
[preproc]
#define KEY2(x) x ## ss
#define KEY(a) KEY2(a)
KEY(pa)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment