vkd3d-shader: Implement #ifndef.

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:08 -06:00
committed by Alexandre Julliard
parent b0dbb35ec7
commit 568983596e
3 changed files with 11 additions and 1 deletions

View File

@@ -184,6 +184,7 @@ static uint32_t preproc_parse_integer(const char *s)
%token T_ENDIF "#endif"
%token T_IF "#if"
%token T_IFDEF "#ifdef"
%token T_IFNDEF "#ifndef"
%type <integer> expr
%type <string> body_token
@@ -225,6 +226,11 @@ directive
preproc_push_if(ctx, !!preproc_find_macro(ctx, $2));
vkd3d_free($2);
}
| T_IFNDEF 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)