Merge pull request #285 from baldurk/vs2010-fixes

VS2010 compilation fixes
This commit is contained in:
John Kessenich 2016-05-17 00:31:36 -06:00
commit bedde872b6
4 changed files with 29 additions and 16 deletions

View File

@ -54,14 +54,14 @@ void SpvBuildLogger::missingFunctionality(const std::string& f)
std::string SpvBuildLogger::getAllMessages() const { std::string SpvBuildLogger::getAllMessages() const {
std::ostringstream messages; std::ostringstream messages;
for (const auto& f : tbdFeatures) for (auto it = tbdFeatures.cbegin(); it != tbdFeatures.cend(); ++it)
messages << "TBD functionality: " << f << "\n"; messages << "TBD functionality: " << *it << "\n";
for (const auto& f : missingFeatures) for (auto it = missingFeatures.cbegin(); it != missingFeatures.cend(); ++it)
messages << "Missing functionality: " << f << "\n"; messages << "Missing functionality: " << *it << "\n";
for (const auto& w : warnings) for (auto it = warnings.cbegin(); it != warnings.cend(); ++it)
messages << "warning: " << w << "\n"; messages << "warning: " << *it << "\n";
for (const auto& e : errors) for (auto it = errors.cbegin(); it != errors.cend(); ++it)
messages << "error: " << e << "\n"; messages << "error: " << *it << "\n";
return messages.str(); return messages.str();
} }

View File

@ -44,8 +44,7 @@ namespace spv {
// missing/TBD functionalities, warnings, and errors. // missing/TBD functionalities, warnings, and errors.
class SpvBuildLogger { class SpvBuildLogger {
public: public:
SpvBuildLogger() = default; SpvBuildLogger() {}
SpvBuildLogger(const SpvBuildLogger&) = delete;
// Registers a TBD functionality. // Registers a TBD functionality.
void tbdFunctionality(const std::string& f); void tbdFunctionality(const std::string& f);
@ -62,6 +61,8 @@ public:
std::string getAllMessages() const; std::string getAllMessages() const;
private: private:
SpvBuildLogger(const SpvBuildLogger&);
std::vector<std::string> tbdFeatures; std::vector<std::string> tbdFeatures;
std::vector<std::string> missingFeatures; std::vector<std::string> missingFeatures;
std::vector<std::string> warnings; std::vector<std::string> warnings;

View File

@ -51,7 +51,7 @@
#define UINT_PTR uintptr_t #define UINT_PTR uintptr_t
#endif #endif
#ifdef __ANDROID__ #if defined(__ANDROID__) || _MSC_VER < 1700
#include <sstream> #include <sstream>
namespace std { namespace std {
template<typename T> template<typename T>
@ -62,6 +62,18 @@ std::string to_string(const T& val) {
} }
} }
#endif #endif
#if defined(_MSC_VER) && _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 */ /* windows only pragma */
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(disable : 4786) // Don't warn about too long identifiers #pragma warning(disable : 4786) // Don't warn about too long identifiers

View File

@ -58,7 +58,7 @@ namespace {
// For members of vector, matrix and arrays, they will be represented with the // 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 // same symbol ID of their container symbol objects. This is because their
// precise'ness is always the same as their container symbol objects. // 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 // The delimiter used in the ObjectAccessChain string to separate symbol ID and
// different level of struct indices. // different level of struct indices.
@ -66,14 +66,14 @@ const char ObjectAccesschainDelimiter = '/';
// Mapping from Symbol IDs of symbol nodes, to their defining operation // Mapping from Symbol IDs of symbol nodes, to their defining operation
// nodes. // nodes.
using NodeMapping = std::unordered_multimap<ObjectAccessChain, glslang::TIntermOperator*>; typedef std::unordered_multimap<ObjectAccessChain, glslang::TIntermOperator*> NodeMapping;
// Mapping from object nodes to their accesschain info string. // Mapping from object nodes to their accesschain info string.
using AccessChainMapping = std::unordered_map<glslang::TIntermTyped*, ObjectAccessChain>; typedef std::unordered_map<glslang::TIntermTyped*, ObjectAccessChain> AccessChainMapping;
// Set of object IDs. // Set of object IDs.
using ObjectAccesschainSet = std::unordered_set<ObjectAccessChain>; typedef std::unordered_set<ObjectAccessChain> ObjectAccesschainSet;
// Set of return branch nodes. // Set of return branch nodes.
using ReturnBranchNodeSet = std::unordered_set<glslang::TIntermBranch*>; typedef std::unordered_set<glslang::TIntermBranch*> ReturnBranchNodeSet;
// A helper function to tell whether a node is 'noContraction'. Returns true if // A helper function to tell whether a node is 'noContraction'. Returns true if
// the node has 'noContraction' qualifier, otherwise false. // the node has 'noContraction' qualifier, otherwise false.