From e2650608cdeb865aec9095bfaa00c28b9803fc8a Mon Sep 17 00:00:00 2001 From: seyko Date: Thu, 19 Mar 2015 08:07:35 +0300 Subject: [PATCH] fix to allow build tcc by build-tcc.bat move call to print_defines() from tcc.c to the libtcc.c define a print_defines() as a ST_FUNC --- libtcc.c | 2 ++ tcc.c | 2 -- tcc.h | 2 +- tccpp.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libtcc.c b/libtcc.c index 94f43242..b04a5cbd 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1338,6 +1338,8 @@ LIBTCCAPI int tcc_add_symbol(TCCState *s, const char *name, const void *val) LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) { s->output_type = output_type; + if (output_type == TCC_OUTPUT_PREPROCESS) + print_defines(); if (!s->nostdinc) { /* default include paths */ diff --git a/tcc.c b/tcc.c index 973c1241..5815adee 100644 --- a/tcc.c +++ b/tcc.c @@ -309,8 +309,6 @@ int main(int argc, char **argv) start_time = getclock_us(); tcc_set_output_type(s, s->output_type); - if (s->output_type == TCC_OUTPUT_PREPROCESS) - print_defines(); /* compile or add each files or library */ for(i = ret = 0; i < s->nb_files && ret == 0; i++) { diff --git a/tcc.h b/tcc.h index 759d3f4f..25c691ac 100644 --- a/tcc.h +++ b/tcc.h @@ -1160,7 +1160,7 @@ ST_INLN void define_push(int v, int macro_type, int *str, Sym *first_arg); ST_FUNC void define_undef(Sym *s); ST_INLN Sym *define_find(int v); ST_FUNC void free_defines(Sym *b); -void print_defines(void); +ST_FUNC void print_defines(void); ST_FUNC Sym *label_find(int v); ST_FUNC Sym *label_push(Sym **ptop, int v, int flags); ST_FUNC void label_pop(Sym **ptop, Sym *slast); diff --git a/tccpp.c b/tccpp.c index 45e394fa..fde07a61 100644 --- a/tccpp.c +++ b/tccpp.c @@ -1155,7 +1155,7 @@ ST_FUNC void free_defines(Sym *b) define_stack = b; } -void print_defines(void) +ST_FUNC void print_defines(void) { Sym *top, *s; int v;