'defined' cannot be used as a macro name in #define or #undef.

This commit is contained in:
Aaron Hamilton 2015-08-19 21:04:18 +00:00
parent d6c37b190b
commit 7d3b73bfff
5 changed files with 9 additions and 0 deletions

View file

@ -2063,6 +2063,8 @@ void TParseContext::reservedPpErrorCheck(const TSourceLoc& loc, const char* iden
// however, before that, ES tests required an error.
if (strncmp(identifier, "GL_", 3) == 0)
ppError(loc, "names beginning with \"GL_\" can't be (un)defined:", op, identifier);
else if (strncmp(identifier, "defined", 8) == 0)
ppError(loc, "\"defined\" can't be (un)defined:", op, identifier);
else if (strstr(identifier, "__") != 0) {
if (profile == EEsProfile && version >= 300 &&
(strcmp(identifier, "__LINE__") == 0 ||