History

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

seyko committed 11 years ago

Commit e2650601 parent aa812e84 files · +4 −4Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t