GLSL: Fix #396: Error when 'defined' comes from macro expansion.
This commit is contained in:
parent
65755667d5
commit
2eb135506a
4 changed files with 24 additions and 1 deletions
|
|
@ -393,6 +393,14 @@ int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, boo
|
|||
TSourceLoc loc = ppToken->loc; // because we sometimes read the newline before reporting the error
|
||||
if (token == PpAtomIdentifier) {
|
||||
if (strcmp("defined", ppToken->name) == 0) {
|
||||
if (isMacroInput()) {
|
||||
if (parseContext.relaxedErrors())
|
||||
parseContext.ppWarn(ppToken->loc, "nonportable when expanded from macros for preprocessor expression",
|
||||
"defined", "");
|
||||
else
|
||||
parseContext.ppError(ppToken->loc, "cannot use in preprocessor expression when expanded from macros",
|
||||
"defined", "");
|
||||
}
|
||||
bool needclose = 0;
|
||||
token = scanToken(ppToken);
|
||||
if (token == '(') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue