glsl/glcpp: move macro declaration before code to fix MSVC build
authorBrian Paul <brianp@vmware.com>
Wed, 9 Jul 2014 23:17:58 +0000 (17:17 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 10 Jul 2014 14:08:10 +0000 (08:08 -0600)
Reviewed-by: Carl Worth <cworth@cworth.org>
src/glsl/glcpp/glcpp-parse.y

index 21c85b410f5e01fd2fe72b3552a7ddff3ffee3e7..084078eb01f7729f779af070fcff27c66bfb613d 100644 (file)
@@ -265,13 +265,14 @@ control_line:
 |      HASH_UNDEF {
                glcpp_parser_resolve_implicit_version(parser);
        } IDENTIFIER NEWLINE {
+               macro_t *macro;
                if (strcmp("__LINE__", $3) == 0
                    || strcmp("__FILE__", $3) == 0
                    || strcmp("__VERSION__", $3) == 0)
                        glcpp_error(& @1, parser, "Built-in (pre-defined)"
                                    " macro names can not be undefined.");
 
-               macro_t *macro = hash_table_find (parser->defines, $3);
+               macro = hash_table_find (parser->defines, $3);
                if (macro) {
                        hash_table_remove (parser->defines, $3);
                        ralloc_free (macro);