From 93e719ba4da7c45cdddd276060acbcc1a4edceda Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 26 Nov 2012 15:00:05 -0800 Subject: [PATCH] glcpp: Make undefined macros illegal in #if and #elif for GLES3 Simply emitting a nicely-formatted error message if any undefined macro is encountered in a parser context expecting an expression. With this commit, the following piglit test now passes: spec/glsl-es-3.00/compiler/undefined-macro.vert Reviewed-by: Matt Turner Reviewed-by: Ian Romanick --- src/glsl/glcpp/glcpp-parse.y | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 76dcd42..8fba923 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -363,6 +363,8 @@ integer_constant: expression: integer_constant | IDENTIFIER { + if (parser->is_gles) + glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $1); $$ = 0; } | expression OR expression { -- 2.7.4