From 786cf4dc483c8959adfbe3487e75391050837817 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 17 May 2016 01:16:46 +0200 Subject: [PATCH 1/6] [VS2010] Change "using X = Y;" to "typedef Y X;" --- glslang/MachineIndependent/propagateNoContraction.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glslang/MachineIndependent/propagateNoContraction.cpp b/glslang/MachineIndependent/propagateNoContraction.cpp index 24e47a74..743a676e 100644 --- a/glslang/MachineIndependent/propagateNoContraction.cpp +++ b/glslang/MachineIndependent/propagateNoContraction.cpp @@ -58,7 +58,7 @@ namespace { // For members of vector, matrix and arrays, they will be represented with the // same symbol ID of their container symbol objects. This is because their // precise'ness is always the same as their container symbol objects. -using ObjectAccessChain = std::string; +typedef std::string ObjectAccessChain; // The delimiter used in the ObjectAccessChain string to separate symbol ID and // different level of struct indices. @@ -66,14 +66,14 @@ const char ObjectAccesschainDelimiter = '/'; // Mapping from Symbol IDs of symbol nodes, to their defining operation // nodes. -using NodeMapping = std::unordered_multimap; +typedef std::unordered_multimap NodeMapping; // Mapping from object nodes to their accesschain info string. -using AccessChainMapping = std::unordered_map; +typedef std::unordered_map AccessChainMapping; // Set of object IDs. -using ObjectAccesschainSet = std::unordered_set; +typedef std::unordered_set ObjectAccesschainSet; // Set of return branch nodes. -using ReturnBranchNodeSet = std::unordered_set; +typedef std::unordered_set ReturnBranchNodeSet; // A helper function to tell whether a node is 'noContraction'. Returns true if // the node has 'noContraction' qualifier, otherwise false. From c1d81cb171546191ce91ec14a9f5222bbc77c030 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 17 May 2016 01:17:06 +0200 Subject: [PATCH 2/6] [VS2010] Remove use of "= default" and "= delete" --- SPIRV/Logger.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SPIRV/Logger.h b/SPIRV/Logger.h index 15b5e354..2e4ddaf5 100644 --- a/SPIRV/Logger.h +++ b/SPIRV/Logger.h @@ -44,8 +44,7 @@ namespace spv { // missing/TBD functionalities, warnings, and errors. class SpvBuildLogger { public: - SpvBuildLogger() = default; - SpvBuildLogger(const SpvBuildLogger&) = delete; + SpvBuildLogger() {} // Registers a TBD functionality. void tbdFunctionality(const std::string& f); @@ -62,6 +61,8 @@ public: std::string getAllMessages() const; private: + SpvBuildLogger(const SpvBuildLogger&); + std::vector tbdFeatures; std::vector missingFeatures; std::vector warnings; From ab44ba757ed97c399c4ad82af1240e00f53e8c61 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 17 May 2016 01:19:23 +0200 Subject: [PATCH 3/6] [VS2010] Remove use of ranged-for loops --- SPIRV/Logger.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SPIRV/Logger.cpp b/SPIRV/Logger.cpp index 7edf4265..48bd4e3a 100644 --- a/SPIRV/Logger.cpp +++ b/SPIRV/Logger.cpp @@ -54,14 +54,14 @@ void SpvBuildLogger::missingFunctionality(const std::string& f) std::string SpvBuildLogger::getAllMessages() const { std::ostringstream messages; - for (const auto& f : tbdFeatures) - messages << "TBD functionality: " << f << "\n"; - for (const auto& f : missingFeatures) - messages << "Missing functionality: " << f << "\n"; - for (const auto& w : warnings) - messages << "warning: " << w << "\n"; - for (const auto& e : errors) - messages << "error: " << e << "\n"; + for (auto it = tbdFeatures.cbegin(); it != tbdFeatures.cend(); ++it) + messages << "TBD functionality: " << *it << "\n"; + for (auto it = missingFeatures.cbegin(); it != missingFeatures.cend(); ++it) + messages << "Missing functionality: " << *it << "\n"; + for (auto it = warnings.cbegin(); it != warnings.cend(); ++it) + messages << "warning: " << *it << "\n"; + for (auto it = errors.cbegin(); it != errors.cend(); ++it) + messages << "error: " << *it << "\n"; return messages.str(); } From bf2c88b6d133d94bebdb5846de77f9c1087b43b5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 17 May 2016 01:23:57 +0200 Subject: [PATCH 4/6] [VS2010] Locally define std::to_string on VS2010 as well as android --- glslang/Include/Common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index 2872fac8..3825253d 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -51,7 +51,7 @@ #define UINT_PTR uintptr_t #endif -#ifdef __ANDROID__ +#if defined(__ANDROID__) || _MSC_VER < 1700 #include namespace std { template From a8018b8ee516f02657617ae72a0d3f745b721efd Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 17 May 2016 01:28:44 +0200 Subject: [PATCH 5/6] [VS2010] Define strtoll() and atoll() functions --- glslang/Include/Common.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index 3825253d..e5c18b99 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -62,6 +62,18 @@ std::string to_string(const T& val) { } } #endif + +#if _MSC_VER < 1700 +inline long long int strtoll (const char* str, char** endptr, int base) +{ + return _strtoi64(str, endptr, base); +} +inline long long int atoll (const char* str) +{ + return strtoll(str, NULL, 10); +} +#endif + /* windows only pragma */ #ifdef _MSC_VER #pragma warning(disable : 4786) // Don't warn about too long identifiers From 6b32ae18fa36f471982bfc537e19bb21703a56c6 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 17 May 2016 01:38:56 +0200 Subject: [PATCH 6/6] Compile fix - if _MSC_VER is undefined, _MSC_VER < 1700 is true! --- glslang/Include/Common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index e5c18b99..05c8447f 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -63,7 +63,7 @@ std::string to_string(const T& val) { } #endif -#if _MSC_VER < 1700 +#if defined(_MSC_VER) && _MSC_VER < 1700 inline long long int strtoll (const char* str, char** endptr, int base) { return _strtoi64(str, endptr, base);