vkd3d-shader: Implement #ifdef.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2021-01-07 11:48:07 -06:00
committed by Alexandre Julliard
parent 9a1317ff0f
commit b0dbb35ec7
2 changed files with 10 additions and 0 deletions

View File

@@ -183,6 +183,7 @@ static uint32_t preproc_parse_integer(const char *s)
%token T_ELSE "#else"
%token T_ENDIF "#endif"
%token T_IF "#if"
%token T_IFDEF "#ifdef"
%type <integer> expr
%type <string> body_token
@@ -219,6 +220,11 @@ directive
if (!preproc_push_if(ctx, !!$2))
YYABORT;
}
| T_IFDEF T_IDENTIFIER T_NEWLINE
{
preproc_push_if(ctx, !!preproc_find_macro(ctx, $2));
vkd3d_free($2);
}
| T_ELIF expr T_NEWLINE
{
if (ctx->if_count)