diff options
| author | grischka <grischka> | 2016-10-17 23:24:01 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2016-10-17 23:24:01 +0200 |
| commit | 0be098929a062d706057d7beb78666daa52bac49 (patch) | |
| tree | 107fa3e4efaf0c080e66475ec50299b8da45f0bd /tccpp.c | |
| parent | 6fbcc14a5d39ca91228f88a64d68a1f3c2d67293 (diff) | |
| download | tinycc-0be098929a062d706057d7beb78666daa52bac49.tar.gz tinycc-0be098929a062d706057d7beb78666daa52bac49.tar.bz2 | |
tccpp_new/delete and other cleanups
Diffstat (limited to 'tccpp.c')
| -rw-r--r-- | tccpp.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -3458,7 +3458,7 @@ ST_INLN void unget_tok(int last_tok) tok = last_tok; } -ST_FUNC void preprocess_init(TCCState *s1) +ST_FUNC void preprocess_start(TCCState *s1) { s1->include_stack_ptr = s1->include_stack; /* XXX: move that before to avoid having to initialize @@ -3477,11 +3477,14 @@ ST_FUNC void preprocess_init(TCCState *s1) (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0; } -ST_FUNC void preprocess_new(void) +ST_FUNC void tccpp_new(TCCState *s) { int i, c; const char *p, *r; + /* might be used in error() before preprocess_start() */ + s->include_stack_ptr = s->include_stack; + /* init isid table */ for(i = CH_EOF; i<128; i++) isidnum_table[i - CH_EOF] @@ -3518,7 +3521,7 @@ ST_FUNC void preprocess_new(void) } } -ST_FUNC void preprocess_delete(void) +ST_FUNC void tccpp_delete(TCCState *s) { int i, n; @@ -3683,7 +3686,7 @@ ST_FUNC int tcc_preprocess(TCCState *s1) const char *p; Sym *define_start; - preprocess_init(s1); + preprocess_start(s1); ch = file->buf_ptr[0]; tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF; parse_flags = PARSE_FLAG_PREPROCESS |
