mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Implement #undef.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
8c927c491c
commit
1fc8b85879
@@ -282,6 +282,7 @@ static const void *get_parent_data(struct preproc_ctx *ctx)
|
||||
%token T_IFDEF "#ifdef"
|
||||
%token T_IFNDEF "#ifndef"
|
||||
%token T_INCLUDE "#include"
|
||||
%token T_UNDEF "#undef"
|
||||
|
||||
%type <integer> expr
|
||||
%type <string> body_token
|
||||
@@ -313,6 +314,18 @@ directive
|
||||
if (!preproc_add_macro(ctx, &@$, $2))
|
||||
YYABORT;
|
||||
}
|
||||
| T_UNDEF T_IDENTIFIER T_NEWLINE
|
||||
{
|
||||
struct preproc_macro *macro;
|
||||
|
||||
if ((macro = preproc_find_macro(ctx, $2)))
|
||||
{
|
||||
TRACE("Removing macro definition %s.\n", debugstr_a($2));
|
||||
rb_remove(&ctx->macros, ¯o->entry);
|
||||
preproc_free_macro(macro);
|
||||
}
|
||||
vkd3d_free($2);
|
||||
}
|
||||
| T_IF expr T_NEWLINE
|
||||
{
|
||||
if (!preproc_push_if(ctx, !!$2))
|
||||
|
||||
Reference in New Issue
Block a user