summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/glcpp-parse.y
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-11-30 09:54:59 +1300
committerChris Forbes <[email protected]>2014-12-07 11:47:45 +1300
commitb49a069bd3c96c8a144bb671863d0757fb421a07 (patch)
treeec48195b0a693416ae998d540a090f805e2588c9 /src/glsl/glcpp/glcpp-parse.y
parented56c16820aea0e115768d77861fe266380f2595 (diff)
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 <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/glcpp-parse.y')
-rw-r--r--src/glsl/glcpp/glcpp-parse.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index f1119eb805a..287792439b5 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -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.");