From b4bb3931c5e7e59496c07c2d4e3b6cfd3bf91cf1 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 29 Jul 2023 18:17:35 -0500 Subject: [PATCH] vkd3d-shader/preproc: Append spaces between tokens in macro invocations. --- libs/vkd3d-shader/preproc.l | 3 +++ tests/preproc-macro.shader_test | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l index 728d6184..d360f6ca 100644 --- a/libs/vkd3d-shader/preproc.l +++ b/libs/vkd3d-shader/preproc.l @@ -746,6 +746,9 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner) if (current_arg) preproc_text_add(current_arg, text); } + + if (current_arg) + preproc_text_add(current_arg, " "); break; } } diff --git a/tests/preproc-macro.shader_test b/tests/preproc-macro.shader_test index 8f073965..96e4b865 100644 --- a/tests/preproc-macro.shader_test +++ b/tests/preproc-macro.shader_test @@ -311,3 +311,9 @@ apple # KEY #define KEY(a) KEY2(a) KEY(pa) + +[preproc] +#define KEY2(x) x +#define KEY KEY2(fa il) +KEY +pass