Skip to content

Commit

Permalink
push_source() now specifies a line number.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 17, 2009
1 parent c9717aa commit 7d4b76d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mojoshader_preprocessor.c
Expand Up @@ -543,7 +543,7 @@ static void free_filename_cache(Context *ctx)


static int push_source(Context *ctx, const char *fname, const char *source,
unsigned int srclen, int included)
unsigned int srclen, unsigned int linenum, int included)
{
IncludeState *state = (IncludeState *) Malloc(ctx, sizeof (IncludeState));
if (state == NULL)
Expand All @@ -565,7 +565,7 @@ static int push_source(Context *ctx, const char *fname, const char *source,
state->source = source;
state->token = source;
state->bytes_left = srclen;
state->line = 1;
state->line = linenum;
state->next = ctx->include_stack;

ctx->include_stack = state;
Expand Down Expand Up @@ -632,7 +632,7 @@ Preprocessor *preprocessor_start(const char *fname, const char *source,
} // if
} // for

if ((okay) && (!push_source(ctx, fname, source, sourcelen, 0)))
if ((okay) && (!push_source(ctx, fname, source, sourcelen, 1, 0)))
okay = 0;

if (!okay)
Expand Down Expand Up @@ -747,7 +747,7 @@ static void handle_pp_include(Context *ctx)
return;
} // if

if (!push_source(ctx, filename, newdata, newbytes, 1))
if (!push_source(ctx, filename, newdata, newbytes, 1, 1))
{
assert(ctx->out_of_memory);
ctx->close_callback(newdata, ctx->malloc, ctx->free, ctx->malloc_data);
Expand Down

0 comments on commit 7d4b76d

Please sign in to comment.