[Mesa-dev] [PATCH 2/3] glcpp: Disallow undefining GL_* builtin macros.

Chris Forbes chrisf at ijw.co.nz
Thu Dec 4 14:16:58 PST 2014


Ugh, yes, I'll fix that and land it at the same time.

Thanks :)

On Fri, Dec 5, 2014 at 11:12 AM, Ian Romanick <idr at freedesktop.org> wrote:
> On 11/29/2014 12:54 PM, Chris Forbes wrote:
>> Fixes the piglit test: spec/glsl-es-3.00/compiler/undef-GL_ES.vert
>>
>> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
>> ---
>>  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 e0ec3b6..bd34faf 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.");
>
> Bonus points for the follow-on patch that s/can not/cannot/.
>
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>


More information about the mesa-dev mailing list