HLSL: Allow macro expansions to create the 'defined' operator.

This commit is contained in:
John Kessenich 2017-06-08 17:12:56 -06:00
parent 3fcb42cfa6
commit 4d5bcd3162
4 changed files with 80 additions and 1 deletions

View file

@ -393,7 +393,7 @@ 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.isReadingHLSL() && isMacroInput()) {
if (parseContext.relaxedErrors())
parseContext.ppWarn(ppToken->loc, "nonportable when expanded from macros for preprocessor expression",
"defined", "");