Mesa (master): glcpp: Disallow undefining GL_* builtin macros.

Chris Forbes chrisf at kemper.freedesktop.org
Sat Dec 6 22:51:03 UTC 2014


Module: Mesa
Branch: master
Commit: b49a069bd3c96c8a144bb671863d0757fb421a07
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b49a069bd3c96c8a144bb671863d0757fb421a07

Author: Chris Forbes <chrisf at ijw.co.nz>
Date:   Sun Nov 30 09:54:59 2014 +1300

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 at ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/glcpp/glcpp-parse.y |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index f1119eb..2877924 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.");
 




More information about the mesa-commit mailing list