mirror of
https://github.com/frida/tinycc
synced 2025-03-18 21:52:53 +03:00
"#pragma once" implementation
This commit is contained in:
parent
0c8447db79
commit
b08ce88082
4
tccpp.c
4
tccpp.c
@ -1478,6 +1478,8 @@ static void pragma_parse(TCCState *s1)
|
||||
}
|
||||
next();
|
||||
skip(')');
|
||||
} else if (tok == TOK_once) {
|
||||
add_cached_include(s1, file->filename, TOK_once);
|
||||
} else {
|
||||
tcc_warning("unknown #pragma %s", get_tok_str(tok, &tokc));
|
||||
}
|
||||
@ -1618,7 +1620,7 @@ ST_FUNC void preprocess(int is_bof)
|
||||
}
|
||||
|
||||
e = search_cached_include(s1, buf1);
|
||||
if (e && define_find(e->ifndef_macro)) {
|
||||
if (e && (define_find(e->ifndef_macro) || e->ifndef_macro == TOK_once)) {
|
||||
/* no need to parse the include because the 'ifndef macro'
|
||||
is defined */
|
||||
#ifdef INC_DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user