aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-01 19:58:13 +0200
committergrischka <grischka>2016-10-01 19:58:13 +0200
commit07e47b3dd68d264a6223c1b74aa64d61a14ac240 (patch)
treef24ad396dc6f740fba335e28f82682fb8bf0d61b /libtcc.c
parentcf32bb8812583583f526ee0faf8c8f7d7799210c (diff)
downloadtinycc-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.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libtcc.c b/libtcc.c
index de8b1f6..dbbc01f 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -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;
}