diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-06-21 12:39:49 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2010-06-21 12:39:49 -0700 |
commit | 62b4b7785a01f11e7fcd9bf76dae6b3c0a16d537 (patch) | |
tree | 9840d33bbb8521fcbeb7a57d0be6a3e0d40c5e2a /glcpp/pp.c | |
parent | 33eaa3e0b3a8f94c2abb23ac3c9cbe571f170fb6 (diff) |
glcpp: Add boolean 'error' flag.
We used to check if the info log is non-empty, but when we print
warnings, this will no longer be valid.
Diffstat (limited to 'glcpp/pp.c')
-rw-r--r-- | glcpp/pp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/glcpp/pp.c b/glcpp/pp.c index f8a7c2ea4d..846d35506f 100644 --- a/glcpp/pp.c +++ b/glcpp/pp.c @@ -26,6 +26,7 @@ void glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...) { + parser->error = 1; parser->info_log = talloc_asprintf_append(parser->info_log, "%u:%u(%u): " "preprocessor error: ", @@ -48,13 +49,13 @@ preprocess(void *talloc_ctx, const char **shader, size_t *shader_len) glcpp_parser_parse (parser); - errors = parser->info_log[0] != '\0'; printf("%s", parser->info_log); talloc_steal(talloc_ctx, parser->output); *shader = parser->output; *shader_len = strlen(parser->output); + errors = parser->error; glcpp_parser_destroy (parser); return errors; } |