diff options
| author | bellard <bellard> | 2002-11-23 22:35:28 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2002-11-23 22:35:28 +0000 |
| commit | 0adc5a8921578d6d9c63841b1e3d401f6fce2140 (patch) | |
| tree | 92e8561fde36ead67c1300029e17079622f83676 /tcc.c | |
| parent | a9f08655aceedfee66bf7c1b840f386c54f2dd82 (diff) | |
| download | tinycc-0adc5a8921578d6d9c63841b1e3d401f6fce2140.tar.gz tinycc-0adc5a8921578d6d9c63841b1e3d401f6fce2140.tar.bz2 | |
fixed line numbering
Diffstat (limited to 'tcc.c')
| -rw-r--r-- | tcc.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -2314,7 +2314,7 @@ static inline void add_cached_include(TCCState *s1, int type, static void preprocess(int is_bof) { TCCState *s1 = tcc_state; - int size, i, c, n, line_num; + int size, i, c, n; char buf[1024], *q, *p; char buf1[1024]; BufferedFile *f; @@ -2529,7 +2529,7 @@ static void preprocess(int is_bof) next(); if (tok != TOK_CINT) error("#line"); - line_num = tokc.i; + file->line_num = tokc.i - 1; /* the line number will be incremented after */ next(); if (tok != TOK_LINEFEED) { if (tok != TOK_STR) @@ -2537,8 +2537,6 @@ static void preprocess(int is_bof) pstrcpy(file->filename, sizeof(file->filename), (char *)tokc.cstr->data); } - /* NOTE: we do it there to avoid problems with linefeed */ - file->line_num = line_num; break; case TOK_ERROR: case TOK_WARNING: @@ -3044,7 +3042,6 @@ static inline void next_nomacro1(void) tcc_close(file); s1->include_stack_ptr--; file = *s1->include_stack_ptr; - inp(); p = file->buf_ptr; goto redo_no_start; } |
