diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y')
-rw-r--r-- | src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y b/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y index b6d3143e60..9fa0f0bf80 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y +++ b/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y @@ -33,6 +33,12 @@ WHICH GENERATES THE GLSL ES preprocessor expression parser. #include "ExpressionParser.h" +#if defined(_MSC_VER) +#include <malloc.h> +#else +#include <stdlib.h> +#endif + #include <cassert> #include <sstream> @@ -146,7 +152,7 @@ expression std::ostringstream stream; stream << $1 << " % " << $3; std::string text = stream.str(); - context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO, + context->diagnostics->report(pp::Diagnostics::PP_DIVISION_BY_ZERO, context->token->location, text.c_str()); YYABORT; @@ -159,7 +165,7 @@ expression std::ostringstream stream; stream << $1 << " / " << $3; std::string text = stream.str(); - context->diagnostics->report(pp::Diagnostics::DIVISION_BY_ZERO, + context->diagnostics->report(pp::Diagnostics::PP_DIVISION_BY_ZERO, context->token->location, text.c_str()); YYABORT; @@ -201,7 +207,7 @@ int yylex(YYSTYPE* lvalp, Context* context) unsigned int val = 0; if (!token->uValue(&val)) { - context->diagnostics->report(pp::Diagnostics::INTEGER_OVERFLOW, + context->diagnostics->report(pp::Diagnostics::PP_INTEGER_OVERFLOW, token->location, token->text); } *lvalp = static_cast<YYSTYPE>(val); @@ -242,7 +248,7 @@ int yylex(YYSTYPE* lvalp, Context* context) void yyerror(Context* context, const char* reason) { - context->diagnostics->report(pp::Diagnostics::INVALID_EXPRESSION, + context->diagnostics->report(pp::Diagnostics::PP_INVALID_EXPRESSION, context->token->location, reason); } @@ -270,12 +276,12 @@ bool ExpressionParser::parse(Token* token, int* result) break; case 2: - mDiagnostics->report(Diagnostics::OUT_OF_MEMORY, token->location, ""); + mDiagnostics->report(Diagnostics::PP_OUT_OF_MEMORY, token->location, ""); break; default: assert(false); - mDiagnostics->report(Diagnostics::INTERNAL_ERROR, token->location, ""); + mDiagnostics->report(Diagnostics::PP_INTERNAL_ERROR, token->location, ""); break; } |