glcpp: Disallow "defined" as a macro name.
[mesa.git] / src / compiler / glsl / glcpp / glcpp-parse.y
index 43a1aa94aff6b9cfb8c3c57d6ea6b05a3b1c9477..70951a022c3236a3d6a09248df2c423cdfb1711f 100644 (file)
@@ -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