summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-02-17 17:15:23 -0800
committerKenneth Graunke <[email protected]>2016-02-18 13:38:50 -0800
commit1c694a6c20da21f31c584fd41d28e2f03522617d (patch)
treeee308423d64785490d732f09e5aa2e32d5181672 /src/compiler
parentdfc95ad6d129436a3d2383152583919fb2dde261 (diff)
glcpp: Disallow "defined" as a macro name.
Both GCC and Clang disallow this, and glslang has recently started disallowing it as well. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94188 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/glcpp/glcpp-parse.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y
index 43a1aa94aff..70951a022c3 100644
--- a/src/compiler/glsl/glcpp/glcpp-parse.y
+++ b/src/compiler/glsl/glcpp/glcpp-parse.y
@@ -2096,6 +2096,9 @@ _check_for_reserved_macro_name (glcpp_parser_t *parser, YYLTYPE *loc,
if (strncmp(identifier, "GL_", 3) == 0) {
glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n");
}
+ if (strcmp(identifier, "defined") == 0) {
+ glcpp_error (loc, parser, "\"defined\" cannot be used as a macro name");
+ }
}
static int