diff options
| author | grischka <grischka> | 2016-10-01 19:58:13 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2016-10-01 19:58:13 +0200 |
| commit | 07e47b3dd68d264a6223c1b74aa64d61a14ac240 (patch) | |
| tree | f24ad396dc6f740fba335e28f82682fb8bf0d61b /libtcc.c | |
| parent | cf32bb8812583583f526ee0faf8c8f7d7799210c (diff) | |
| download | tinycc-07e47b3dd68d264a6223c1b74aa64d61a14ac240.tar.gz tinycc-07e47b3dd68d264a6223c1b74aa64d61a14ac240.tar.bz2 | |
tccpp: restore -D symbols for multiple sources
... also for built-in defines
The case:
$ tcc -D FOO a.c b.c
with
// a.c
#undef FOO
// b.c
#ifndef FOO
# error -D FOO has been lost
#endif
Diffstat (limited to 'libtcc.c')
| -rw-r--r-- | libtcc.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -964,8 +964,8 @@ static int tcc_compile(TCCState *s1) decl(VT_CONST); if (tok != TOK_EOF) expect("declaration"); + gen_inline_functions(); check_vstack(); - /* end of translation unit info */ if (s1->do_debug) { put_stabs_r(NULL, N_SO, 0, 0, @@ -974,16 +974,10 @@ static int tcc_compile(TCCState *s1) } s1->error_set_jmp_enabled = 0; - - /* reset define stack, but leave -Dsymbols (may be incorrect if - they are undefined) */ + /* reset define stack, but keep -D and built-ins */ free_defines(define_start); - - gen_inline_functions(); - sym_pop(&global_stack, NULL); sym_pop(&local_stack, NULL); - return s1->nb_errors != 0 ? -1 : 0; } |
