diff options
Diffstat (limited to 'src/preproc.c')
-rw-r--r-- | src/preproc.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/preproc.c b/src/preproc.c index 1eeddd0..a5dda52 100644 --- a/src/preproc.c +++ b/src/preproc.c @@ -57,2 +57,3 @@ static size_t linebufsize = 0; #define LOCUS context_stack->locus +#define POINT context_stack->locus.beg @@ -125,4 +126,4 @@ pp_line_stmt() "#line %lu \"%s\" %lu\n", - (unsigned long) LOCUS.line, - LOCUS.file, (unsigned long) context_stack->xlines)) + (unsigned long) POINT.line, + POINT.file, (unsigned long) context_stack->xlines)) grecs_alloc_die(); @@ -213,3 +214,3 @@ grecs_preproc_fill_buffer(char *buf, size_t size) if (!is_line && len > 0 && linebuf[len - 1] == '\n') - LOCUS.line++; + POINT.line++; } @@ -399,3 +400,3 @@ push_source(const char *name, int once) - if (LOCUS.file && STAT_ID_EQ(st, context_stack->id)) { + if (POINT.file && STAT_ID_EQ(st, context_stack->id)) { grecs_error(&LOCUS, 0, _("Recursive inclusion")); @@ -433,6 +434,9 @@ push_source(const char *name, int once) ctx = grecs_malloc(sizeof(*ctx)); - ctx->locus.file = grecs_install_text(name); - ctx->locus.line = 1; + ctx->locus.beg.file = grecs_install_text(name); + ctx->locus.beg.line = 1; + ctx->locus.beg.col = 0; + ctx->locus.end.file = NULL; + ctx->locus.end.line = ctx->locus.end.col = 0; ctx->xlines = 0; - ctx->namelen = strlen(ctx->locus.file); + ctx->namelen = strlen(ctx->locus.beg.file); ctx->id.i_node = st.st_ino; @@ -472,3 +476,3 @@ pop_source() - LOCUS.line++; + POINT.line++; @@ -476,3 +480,3 @@ pop_source() fprintf(stderr, "Resuming file `%s' at line %lu\n", - LOCUS.file, (unsigned long) LOCUS.line); + POINT.file, (unsigned long) POINT.line); |