aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/glcpp-parse.y
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-09-07 18:01:33 -0700
committerKenneth Graunke <[email protected]>2010-09-07 18:01:33 -0700
commit48e789d71e01b0a7185555735b4a26b1a53d0825 (patch)
tree48c95a287e82fc9dd9a21a56f89d36347c675ad3 /src/glsl/glcpp/glcpp-parse.y
parent10eaa8bcbce1cd6d2e120e913f7abafde9675215 (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.y7
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