Unified · Split
| @@ -1338,6 +1338,8 @@ LIBTCCAPI int tcc_add_symbol(TCCState *s, const char *name, const void *val) · 1337 unmodified lines | ||
| 1338 | 1338 | LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) |
| 1339 | 1339 | { |
| 1340 | 1340 | s->output_type = output_type; |
| 1341 | + if (output_type == TCC_OUTPUT_PREPROCESS) | |
| 1342 | + print_defines(); | |
| 1341 | 1343 | |
| 1342 | 1344 | if (!s->nostdinc) { |
| 1343 | 1345 | /* default include paths */ |
| @@ -309,8 +309,6 @@ int main(int argc, char **argv) · 308 unmodified lines | ||
| 309 | 309 | start_time = getclock_us(); |
| 310 | 310 | |
| 311 | 311 | tcc_set_output_type(s, s->output_type); |
| 312 | − if (s->output_type == TCC_OUTPUT_PREPROCESS) | |
| 313 | − print_defines(); | |
| 314 | 312 | |
| 315 | 313 | /* compile or add each files or library */ |
| 316 | 314 | for(i = ret = 0; i < s->nb_files && ret == 0; i++) { |
| @@ -1160,7 +1160,7 @@ ST_INLN void define_push(int v, int macro_type, int *str, Sym *first_arg); · 1159 unmodified lines | ||
| 1160 | 1160 | ST_FUNC void define_undef(Sym *s); |
| 1161 | 1161 | ST_INLN Sym *define_find(int v); |
| 1162 | 1162 | ST_FUNC void free_defines(Sym *b); |
| 1163 | −void print_defines(void); | |
| 1163 | +ST_FUNC void print_defines(void); | |
| 1164 | 1164 | ST_FUNC Sym *label_find(int v); |
| 1165 | 1165 | ST_FUNC Sym *label_push(Sym **ptop, int v, int flags); |
| 1166 | 1166 | ST_FUNC void label_pop(Sym **ptop, Sym *slast); |
| @@ -1155,7 +1155,7 @@ ST_FUNC void free_defines(Sym *b) · 1154 unmodified lines | ||
| 1155 | 1155 | define_stack = b; |
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | −void print_defines(void) | |
| 1158 | +ST_FUNC void print_defines(void) | |
| 1159 | 1159 | { |
| 1160 | 1160 | Sym *top, *s; |
| 1161 | 1161 | int v; |