From 8268a3550483a5021f662ee76a3cad69262c698b Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Fri, 25 Aug 2017 21:09:15 -0600 Subject: [PATCH] Build: Attempt better support for VS 2012. Fix #1020. Fix #1021. Fix #1022. --- SPIRV/hex_float.h | 2 +- glslang/Include/Common.h | 2 +- glslang/MachineIndependent/ParseHelper.h | 3 ++- glslang/MachineIndependent/localintermediate.h | 9 ++++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/SPIRV/hex_float.h b/SPIRV/hex_float.h index 31b9f9e..905b21a 100644 --- a/SPIRV/hex_float.h +++ b/SPIRV/hex_float.h @@ -23,7 +23,7 @@ #include #include -#if defined(_MSC_VER) && _MSC_VER < 1700 +#if defined(_MSC_VER) && _MSC_VER < 1800 namespace std { bool isnan(double f) { diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index 0f2c908..0820154 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -63,7 +63,7 @@ std::string to_string(const T& val) { } #endif -#if defined(_MSC_VER) && _MSC_VER < 1700 +#if defined(_MSC_VER) && _MSC_VER < 1800 inline long long int strtoll (const char* str, char** endptr, int base) { return _strtoi64(str, endptr, base); diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index 73f2470..d04607a 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -76,6 +76,7 @@ public: EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) : TParseVersions(interm, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), + scopeMangler("::"), symbolTable(symbolTable), statementNestingLevel(0), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), postEntryPointReturn(false), @@ -143,7 +144,7 @@ public: virtual bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*); virtual void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*); - const char* const scopeMangler = "::"; + const char* const scopeMangler; // Basic parsing state, easily accessible to the grammar diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index d3219cc..9f6e3da 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -208,11 +208,14 @@ class TVariable; class TIntermediate { public: explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : + implicitThisName("@this"), language(l), source(EShSourceNone), profile(p), version(v), treeRoot(0), numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), - invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), inputPrimitive(ElgNone), outputPrimitive(ElgNone), + invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), + inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false), - vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), postDepthCoverage(false), depthLayout(EldNone), depthReplacing(false), + vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), + postDepthCoverage(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0), xfbMode(false), multiStream(false), #ifdef NV_EXTENSIONS layoutOverrideCoverage(false), @@ -607,7 +610,7 @@ public: void addProcessArgument(const std::string& arg) { processes.addArgument(arg); } const std::vector& getProcesses() const { return processes.getProcesses(); } - const char* const implicitThisName = "@this"; + const char* const implicitThisName; protected: TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); -- 2.7.4