From: Kenneth Graunke Date: Fri, 2 Jul 2010 22:31:26 +0000 (-0700) Subject: glcpp: Add #error support. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e908a6a27f196027a4dfd0f4d8c37aa71e163fa;p=mesa.git glcpp: Add #error support. --- diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l index afddd7ddb32..6a91b09954a 100644 --- a/src/glsl/glcpp/glcpp-lex.l +++ b/src/glsl/glcpp/glcpp-lex.l @@ -24,6 +24,7 @@ #include #include +#include #include "glcpp.h" #include "glcpp-parse.h" @@ -139,6 +140,13 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? } } +{HASH}error.* { + char *p; + for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */ + p += 5; /* skip "error" */ + glcpp_error(yylloc, yyextra, "#error%s", p); +} + {HASH}define{HSPACE}+/{IDENTIFIER}"(" { yyextra->space_tokens = 0; return HASH_DEFINE_FUNC;