History

tccpp: fix quirk with cached headers and #else

Such as with #ifndef FOO_H ... #else ... #endif

grischka committed 17 years ago

Commit 569c20f1 parent 1026ca51 file · +4 −1Browse files

Unified · Split

tccpp.c+4−1
@@ -1392,7 +1392,7 @@ include_done: · 1391 unmodified lines
13921392 if (s1->ifdef_stack_ptr[-1] & 2)
13931393 error("#else after #else");
13941394 c = (s1->ifdef_stack_ptr[-1] ^= 3);
1395− goto test_skip;
1395+ goto test_else;
13961396 case TOK_ELIF:
13971397 if (s1->ifdef_stack_ptr == s1->ifdef_stack)
13981398 error("#elif without matching #if");
@@ -1404,6 +1404,9 @@ include_done: · 5 unmodified lines
14041404 goto skip;
14051405 c = expr_preprocess();
14061406 s1->ifdef_stack_ptr[-1] = c;
1407+ test_else:
1408+ if (s1->ifdef_stack_ptr == file->ifdef_stack_ptr + 1)
1409+ file->ifndef_macro = 0;
14071410 test_skip:
14081411 if (!(c & 1)) {
14091412 skip:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t