Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wine
vkd3d
Commits
6fc3ae2b
Commit
6fc3ae2b
authored
1 year ago
by
Elizabeth Figura
Committed by
Alexandre Julliard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
vkd3d-shader/preproc: Stringify text immediately in macro invocations.
parent
cbb1d840
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!291
vkd3d-shader/preproc: Various fixes.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libs/vkd3d-shader/preproc.l
+15
-0
15 additions, 0 deletions
libs/vkd3d-shader/preproc.l
tests/hlsl_d3d12.c
+21
-0
21 additions, 0 deletions
tests/hlsl_d3d12.c
with
36 additions
and
0 deletions
libs/vkd3d-shader/preproc.l
+
15
−
0
View file @
6fc3ae2b
...
...
@@ -664,6 +664,21 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
break;
}
/* Stringification is another special case. Unsurprisingly,
* we need to stringify if this is an argument. More
* surprisingly, we need to stringify even if it's not. */
case T_HASHSTRING:
{
struct vkd3d_string_buffer buffer;
vkd3d_string_buffer_init(&buffer);
preproc_stringify(ctx, &buffer, text);
if (current_arg)
preproc_text_add(current_arg, buffer.buffer);
vkd3d_string_buffer_cleanup(&buffer);
break;
}
case T_NEWLINE:
if (current_arg)
preproc_text_add(current_arg, " ");
...
...
This diff is collapsed.
Click to expand it.
tests/hlsl_d3d12.c
+
21
−
0
View file @
6fc3ae2b
...
...
@@ -236,6 +236,27 @@ static void test_preprocess(void)
"#"
,
},
{
"#define KEY2(x) x
\n
"
"#define KEY(a) KEY2(#a)
\n
"
"KEY(apple)"
,
"
\"
apple
\"
"
,
},
{
"#define KEY2(x) #x
\n
"
"#define KEY(a) KEY2(#a)
\n
"
"KEY(apple)"
,
"
\"\\\"
apple
\\\"\"
"
,
},
{
"#define KEY2(x) #x
\n
"
"#define KEY(a) KEY2(#x)
\n
"
"KEY(apple)"
,
"
\"\\\"
x
\\\"\"
"
,
},
/* #pragma is preserved. */
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment