mirror of
https://github.com/frida/tinycc
synced 2024-12-28 23:59:41 +03:00
tccpp: fix quirk with cached headers and #else
Such as with #ifndef FOO_H ... #else ... #endif
This commit is contained in:
parent
1026ca5888
commit
569c20f104
5
tccpp.c
5
tccpp.c
@ -1392,7 +1392,7 @@ include_done:
|
||||
if (s1->ifdef_stack_ptr[-1] & 2)
|
||||
error("#else after #else");
|
||||
c = (s1->ifdef_stack_ptr[-1] ^= 3);
|
||||
goto test_skip;
|
||||
goto test_else;
|
||||
case TOK_ELIF:
|
||||
if (s1->ifdef_stack_ptr == s1->ifdef_stack)
|
||||
error("#elif without matching #if");
|
||||
@ -1404,6 +1404,9 @@ include_done:
|
||||
goto skip;
|
||||
c = expr_preprocess();
|
||||
s1->ifdef_stack_ptr[-1] = c;
|
||||
test_else:
|
||||
if (s1->ifdef_stack_ptr == file->ifdef_stack_ptr + 1)
|
||||
file->ifndef_macro = 0;
|
||||
test_skip:
|
||||
if (!(c & 1)) {
|
||||
skip:
|
||||
|
Loading…
Reference in New Issue
Block a user