Allow 'defined' in define in non-WebGL.
This is needed to pass dEQP conformance. Several of the harder dEQP
tests around this behaviour are excluded from the mustpass list. This
is presumably because the behaviours weren't implemented portably.
Nevertheless we need to support conformant behaviour for GLES 2.0
Contexts for the most simple uses.
This also leaves the error behaviour intact for WebGL specs.
Bug: angleproject:1335
Change-Id: Ia80b4f71475efa928488ee6c2ee35c566d4602d4
Reviewed-on: https://chromium-review.googlesource.com/c/1242013
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/preprocessor/MacroExpander.h b/src/compiler/preprocessor/MacroExpander.h
index e5cde5f..837bd73 100644
--- a/src/compiler/preprocessor/MacroExpander.h
+++ b/src/compiler/preprocessor/MacroExpander.h
@@ -12,6 +12,7 @@
#include "compiler/preprocessor/Lexer.h"
#include "compiler/preprocessor/Macro.h"
+#include "compiler/preprocessor/Preprocessor.h"
namespace angle
{
@@ -28,7 +29,8 @@
MacroExpander(Lexer *lexer,
MacroSet *macroSet,
Diagnostics *diagnostics,
- int allowedMacroExpansionDepth);
+ const PreprocessorSettings &settings,
+ bool parseDefined);
~MacroExpander() override;
void lex(Token *token) override;
@@ -68,12 +70,13 @@
Lexer *mLexer;
MacroSet *mMacroSet;
Diagnostics *mDiagnostics;
+ bool mParseDefined;
std::unique_ptr<Token> mReserveToken;
std::vector<MacroContext *> mContextStack;
size_t mTotalTokensInContexts;
- int mAllowedMacroExpansionDepth;
+ PreprocessorSettings mSettings;
bool mDeferReenablingMacros;
std::vector<std::shared_ptr<Macro>> mMacrosToReenable;