mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 22:31:36 +00:00
Unary NOT in #if
This commit is contained in:
parent
bdd8b8275e
commit
45a354d664
1 changed files with 10 additions and 0 deletions
10
ftepp.c
10
ftepp.c
|
@ -198,10 +198,18 @@ static bool ftepp_define(ftepp_t *ftepp)
|
|||
static bool ftepp_if_expr(ftepp_t *ftepp, bool *out)
|
||||
{
|
||||
ppmacro *macro;
|
||||
bool wasnot = false;
|
||||
|
||||
if (!ftepp_skipspace(ftepp))
|
||||
return false;
|
||||
|
||||
while (ftepp->token == '!') {
|
||||
wasnot = true;
|
||||
ftepp_next(ftepp);
|
||||
if (!ftepp_skipspace(ftepp))
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (ftepp->token) {
|
||||
case TOKEN_IDENT:
|
||||
case TOKEN_TYPENAME:
|
||||
|
@ -278,6 +286,8 @@ static bool ftepp_if_expr(ftepp_t *ftepp, bool *out)
|
|||
ftepp_error(ftepp, "junk in #if");
|
||||
return false;
|
||||
}
|
||||
if (wasnot)
|
||||
*out = !*out;
|
||||
|
||||
ftepp->lex->flags.noops = false;
|
||||
ftepp_next(ftepp);
|
||||
|
|
Loading…
Reference in a new issue