forked from Mirrors/tinycc
tccpp: fix quirk with cached headers and #else
Such as with #ifndef FOO_H ... #else ... #endiftcc-xref
parent
1026ca5888
commit
569c20f104
5
tccpp.c
5
tccpp.c
|
@ -1392,7 +1392,7 @@ include_done:
|
||||||
if (s1->ifdef_stack_ptr[-1] & 2)
|
if (s1->ifdef_stack_ptr[-1] & 2)
|
||||||
error("#else after #else");
|
error("#else after #else");
|
||||||
c = (s1->ifdef_stack_ptr[-1] ^= 3);
|
c = (s1->ifdef_stack_ptr[-1] ^= 3);
|
||||||
goto test_skip;
|
goto test_else;
|
||||||
case TOK_ELIF:
|
case TOK_ELIF:
|
||||||
if (s1->ifdef_stack_ptr == s1->ifdef_stack)
|
if (s1->ifdef_stack_ptr == s1->ifdef_stack)
|
||||||
error("#elif without matching #if");
|
error("#elif without matching #if");
|
||||||
|
@ -1404,6 +1404,9 @@ include_done:
|
||||||
goto skip;
|
goto skip;
|
||||||
c = expr_preprocess();
|
c = expr_preprocess();
|
||||||
s1->ifdef_stack_ptr[-1] = c;
|
s1->ifdef_stack_ptr[-1] = c;
|
||||||
|
test_else:
|
||||||
|
if (s1->ifdef_stack_ptr == file->ifdef_stack_ptr + 1)
|
||||||
|
file->ifndef_macro = 0;
|
||||||
test_skip:
|
test_skip:
|
||||||
if (!(c & 1)) {
|
if (!(c & 1)) {
|
||||||
skip:
|
skip:
|
||||||
|
|
Loading…
Reference in New Issue