diff options
author | Michal Krol <[email protected]> | 2009-12-19 09:55:27 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2009-12-20 21:18:57 +0100 |
commit | e9aa65d2b751f81fecd365fd6a550562417a3ec2 (patch) | |
tree | 4d02b2597425e6e71f6616760a9a6a626a9638d2 /src/glsl/pp/sl_pp_context.c | |
parent | a6e663def416f73ea8c0c65e8ee6a4dfaaeffae2 (diff) |
glsl/pp: Report correct error line for purify and tokeniser errors.
Diffstat (limited to 'src/glsl/pp/sl_pp_context.c')
-rw-r--r-- | src/glsl/pp/sl_pp_context.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index afc1b84d16a..2ce50790313 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -56,6 +56,7 @@ sl_pp_context_create(void) context->if_ptr = SL_PP_MAX_IF_NESTING; context->if_value = 1; memset(context->error_msg, 0, sizeof(context->error_msg)); + context->error_line = 1; context->line = 1; context->file = 0; @@ -79,6 +80,19 @@ sl_pp_context_error_message(const struct sl_pp_context *context) return context->error_msg; } +void +sl_pp_context_error_position(const struct sl_pp_context *context, + unsigned int *file, + unsigned int *line) +{ + if (file) { + *file = 0; + } + if (line) { + *line = context->error_line; + } +} + int sl_pp_context_add_predefined(struct sl_pp_context *context, const char *name, |