diff options
Diffstat (limited to 'Source/ThirdParty/ANGLE/src/compiler/preprocessor/Macro.cpp')
| -rw-r--r-- | Source/ThirdParty/ANGLE/src/compiler/preprocessor/Macro.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Macro.cpp b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Macro.cpp index b2e3088e3..f5c94399d 100644 --- a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Macro.cpp +++ b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Macro.cpp @@ -4,14 +4,15 @@ // found in the LICENSE file. // -#include "Macro.h" +#include "compiler/preprocessor/Macro.h" -#include "Token.h" +#include "common/angleutils.h" +#include "compiler/preprocessor/Token.h" namespace pp { -bool Macro::equals(const Macro& other) const +bool Macro::equals(const Macro &other) const { return (type == other.type) && (name == other.name) && @@ -19,5 +20,20 @@ bool Macro::equals(const Macro& other) const (replacements == other.replacements); } +void PredefineMacro(MacroSet *macroSet, const char *name, int value) +{ + Token token; + token.type = Token::CONST_INT; + token.text = ToString(value); + + Macro macro; + macro.predefined = true; + macro.type = Macro::kTypeObj; + macro.name = name; + macro.replacements.push_back(token); + + (*macroSet)[name] = macro; +} + } // namespace pp |
