[Mesa-dev] [PATCH 2/2] glcpp: Make undefined macros illegal in #if and #elif for GLES3

Ian Romanick idr at freedesktop.org
Tue Nov 27 11:20:38 PST 2012


On 11/26/2012 03:12 PM, Carl Worth wrote:
> Simply emitting a nicely-formatted error message if any undefined macro is
> encoutnered in a parser context expecting an expression.

I assume this makes the piglit test pass?  That should be mentioned in 
the commit message.  Assuming that's the case, the series is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   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 258eb6e..bdf7e17 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 {
>



More information about the mesa-dev mailing list