glcpp: Disallow undefining GL_* builtin macros.

Fixes the piglit test: spec/glsl-es-3.00/compiler/undef-GL_ES.vert

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Chris Forbes 2014-11-30 09:54:59 +13:00
parent ed56c16820
commit b49a069bd3
1 changed files with 2 additions and 1 deletions

View File

@ -290,7 +290,8 @@ control_line_success:
macro_t *macro;
if (strcmp("__LINE__", $4) == 0
|| strcmp("__FILE__", $4) == 0
|| strcmp("__VERSION__", $4) == 0)
|| strcmp("__VERSION__", $4) == 0
|| strncmp("GL_", $4, 3) == 0)
glcpp_error(& @1, parser, "Built-in (pre-defined)"
" macro names can not be undefined.");