diff options
| author | 2025-12-02 18:24:54 +0100 | |
|---|---|---|
| committer | 2025-12-02 18:24:54 +0100 | |
| commit | bfd58e2c515e8c360fda4bee3d0702c60d92ebf0 (patch) | |
| tree | 33f11ac7d4d56cbbe65cdf79753728b7fd4dfc9c /io.c | |
| parent | 3c6e4dd54d5c144369b96d6673da7f23df4940da (diff) | |
preprocessor: add #ifndef...#endif include guard optimization
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -818,6 +818,7 @@ static struct file { vec_of(uint) lineoffs; bool once; bool seen; + const char *guardmac; } *fileht[1<<SPANFILEBITS]; static int nfiles; @@ -913,19 +914,21 @@ getfilepos(int *line, int *col, int id, uint off) } bool -isoncefile(int id) +isoncefile(int id, const char **guard) { assert(id < arraylength(fileht) && fileht[id]); + *guard = fileht[id]->guardmac; return fileht[id]->once; } + void -markfileonce(int id) +markfileonce(int id, const char *guard) { assert(id < arraylength(fileht) && fileht[id]); fileht[id]->once = 1; + fileht[id]->guardmac = guard; } - void markfileseen(int id) { |