summaryrefslogtreecommitdiff
path: root/glcpp/pp.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-06-17 12:03:25 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-06-21 12:31:02 -0700
commitf1e6c069fac93dd2b7b2026ccd24833a066c895a (patch)
tree37bd98609c64e6b87c05308c6c69f567c4208920 /glcpp/pp.c
parentb78c9ddfbfecb983f7ab519bb07889333bdab959 (diff)
glcpp: Introduce new glcpp_error function.
Diffstat (limited to 'glcpp/pp.c')
-rw-r--r--glcpp/pp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/glcpp/pp.c b/glcpp/pp.c
index 04ea0a4797..5d1ff8c682 100644
--- a/glcpp/pp.c
+++ b/glcpp/pp.c
@@ -23,6 +23,20 @@
#include "glcpp.h"
+void
+glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...)
+{
+ parser->errors = talloc_asprintf_append(parser->errors, "%u:%u(%u): "
+ "preprocessor error: ",
+ locp->source, locp->first_line,
+ locp->first_column);
+ va_list ap;
+ va_start(ap, fmt);
+ parser->errors = talloc_vasprintf_append(parser->errors, fmt, ap);
+ va_end(ap);
+ parser->errors = talloc_strdup_append(parser->errors, "\n");
+}
+
extern int
preprocess(void *talloc_ctx, const char **shader, size_t *shader_len)
{