Fix pragma once guard

From: Vlad Vissoultchev
    Date: Mon, 11 Apr 2016 01:26:32 +0300
    Subject: Fix pragma once guard when compiling multiple source files

    When compiling multiple source files directly to executable cached
    include files guard was incorrectly checked for TOK_once in ifndef_macro
    member.

    If two source files included the same header guarded by pragma once, then
    the second one erroneously skipped it as `cached_includes` is not cleared
    on second `tcc_compile`
This commit is contained in:
seyko
2016-04-13 06:17:02 +03:00
parent b0296139a8
commit b5b3e89f9e
2 changed files with 6 additions and 3 deletions

2
tcc.c
View File

@ -344,7 +344,7 @@ int main(int argc, char **argv)
tcc_parse_args(s, argc - 1, argv + 1);
tcc_set_environment(s);
if (s->output_type != TCC_OUTPUT_OBJ)
tcc_error("interlnal error");
tcc_error("internal error");
tcc_set_output_type(s, s->output_type);
}
}