void
yyerror (YYLTYPE *locp, glcpp_parser_t *parser, const char *error)
{
- glcpp_printf(parser->errors, "%u:%u(%u): preprocessor error: %s\n",
- locp->source, locp->first_line, locp->first_column, error);
+ glcpp_error(locp, parser, "%s", error);
}
glcpp_parser_t *
void
glcpp_parser_destroy (glcpp_parser_t *parser);
+void
+glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...);
+
/* Generated by glcpp-lex.l to glcpp-lex.c */
int
#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)
{