Manual merge of Ehsan Akhgari's patch to rename Diagnostics enums to avoid collision with Windows.h
(See https://chromium-review.googlesource.com/#/c/177181/3)
Change-Id: I2978d06ec96789b3ee1696b65a84c2a9f31f7ba4
diff --git a/src/compiler/translator/DirectiveHandler.cpp b/src/compiler/translator/DirectiveHandler.cpp
index 301a982..59d2835 100644
--- a/src/compiler/translator/DirectiveHandler.cpp
+++ b/src/compiler/translator/DirectiveHandler.cpp
@@ -41,7 +41,7 @@
void TDirectiveHandler::handleError(const pp::SourceLocation& loc,
const std::string& msg)
{
- mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc, msg, "", "");
+ mDiagnostics.writeInfo(pp::Diagnostics::PP_ERROR, loc, msg, "", "");
}
void TDirectiveHandler::handlePragma(const pp::SourceLocation& loc,
@@ -75,12 +75,12 @@
}
else
{
- mDiagnostics.report(pp::Diagnostics::UNRECOGNIZED_PRAGMA, loc, name);
+ mDiagnostics.report(pp::Diagnostics::PP_UNRECOGNIZED_PRAGMA, loc, name);
return;
}
if (invalidValue)
- mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+ mDiagnostics.writeInfo(pp::Diagnostics::PP_ERROR, loc,
"invalid pragma value", value,
"'on' or 'off' expected");
}
@@ -94,7 +94,7 @@
TBehavior behaviorVal = getBehavior(behavior);
if (behaviorVal == EBhUndefined)
{
- mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+ mDiagnostics.writeInfo(pp::Diagnostics::PP_ERROR, loc,
"behavior", name, "invalid");
return;
}
@@ -103,13 +103,13 @@
{
if (behaviorVal == EBhRequire)
{
- mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+ mDiagnostics.writeInfo(pp::Diagnostics::PP_ERROR, loc,
"extension", name,
"cannot have 'require' behavior");
}
else if (behaviorVal == EBhEnable)
{
- mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+ mDiagnostics.writeInfo(pp::Diagnostics::PP_ERROR, loc,
"extension", name,
"cannot have 'enable' behavior");
}
@@ -129,15 +129,15 @@
return;
}
- pp::Diagnostics::Severity severity = pp::Diagnostics::ERROR;
+ pp::Diagnostics::Severity severity = pp::Diagnostics::PP_ERROR;
switch (behaviorVal) {
case EBhRequire:
- severity = pp::Diagnostics::ERROR;
+ severity = pp::Diagnostics::PP_ERROR;
break;
case EBhEnable:
case EBhWarn:
case EBhDisable:
- severity = pp::Diagnostics::WARNING;
+ severity = pp::Diagnostics::PP_WARNING;
break;
default:
UNREACHABLE();
@@ -160,7 +160,7 @@
std::stringstream stream;
stream << version;
std::string str = stream.str();
- mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+ mDiagnostics.writeInfo(pp::Diagnostics::PP_ERROR, loc,
"version number", str, "not supported");
}
}