diff options
author | Kenneth Graunke <[email protected]> | 2010-09-07 18:01:33 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2010-09-07 18:01:33 -0700 |
commit | 48e789d71e01b0a7185555735b4a26b1a53d0825 (patch) | |
tree | 48c95a287e82fc9dd9a21a56f89d36347c675ad3 /src/glsl/glcpp/glcpp-parse.y | |
parent | 10eaa8bcbce1cd6d2e120e913f7abafde9675215 (diff) |
glcpp: Fix build on non-GCC compilers.
Diffstat (limited to 'src/glsl/glcpp/glcpp-parse.y')
-rw-r--r-- | src/glsl/glcpp/glcpp-parse.y | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 4463a977778..43513ebb66b 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -310,15 +310,16 @@ control_line: _glcpp_parser_skip_stack_pop (parser, & @1); } | HASH_VERSION integer_constant NEWLINE { - if ($2 == 100) - add_builtin_define (parser, "GL_ES", 1); - macro_t *macro = hash_table_find (parser->defines, "__VERSION__"); if (macro) { hash_table_remove (parser->defines, "__VERSION__"); talloc_free (macro); } add_builtin_define (parser, "__VERSION__", $2); + + if ($2 == 100) + add_builtin_define (parser, "GL_ES", 1); + glcpp_printf(parser->output, "#version %" PRIiMAX, $2); } | HASH NEWLINE |