On Fri, Jun 6, 2014 at 4:56 PM, Anuj Phogat <anuj.pho...@gmail.com> wrote: > A compile error will be generated for redefinition of these macros. > > Cc: <mesa-sta...@lists.freedesktop.org> > Signed-off-by: Anuj Phogat <anuj.pho...@gmail.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 9887583..2ddc8b9 100644 > --- a/src/glsl/glcpp/glcpp-parse.y > +++ b/src/glsl/glcpp/glcpp-parse.y > @@ -2053,6 +2053,8 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t > *parser, intmax_t versio > > parser->version_resolved = true; > > + add_builtin_define (parser, "__FILE__", version); > + add_builtin_define (parser, "__LINE__", version);
In order to give an error on redefinition of these, we define them to something meaningless, i.e., version? I guess that works, since we have special handling of their expansion. Wouldn't it be better to handle them specially like we do in patch #2? > add_builtin_define (parser, "__VERSION__", version); _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev