mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/preproc: Expand macro arguments in macro invocations.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55361
This commit is contained in:
parent
9b98489155
commit
3a235b57f6
Notes:
Alexandre Julliard
2023-08-02 21:24:27 +09:00
Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/291
@ -634,6 +634,26 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
|
|||||||
|
|
||||||
switch (token)
|
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:
|
case T_NEWLINE:
|
||||||
if (current_arg)
|
if (current_arg)
|
||||||
preproc_text_add(current_arg, " ");
|
preproc_text_add(current_arg, " ");
|
||||||
|
@ -305,3 +305,9 @@ __LINE__
|
|||||||
[preproc]
|
[preproc]
|
||||||
#define KEY pass
|
#define KEY pass
|
||||||
apple # KEY
|
apple # KEY
|
||||||
|
|
||||||
|
[preproc]
|
||||||
|
#define KEY2(x) x ## ss
|
||||||
|
#define KEY(a) KEY2(a)
|
||||||
|
|
||||||
|
KEY(pa)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user