Merge pull request #9727 from zzmp/fix/ktx-noexcept

macro NOEXCEPT for ktx on msvc
This commit is contained in:
samcake 2017-02-22 13:07:08 -08:00 committed by GitHub
commit b40e4d4e85
2 changed files with 13 additions and 2 deletions

View file

@ -13,11 +13,17 @@
#include <list>
#include <QtGlobal>
#ifndef _MSC_VER
#define NOEXCEPT noexcept
#else
#define NOEXCEPT
#endif
namespace ktx {
class ReaderException: public std::exception {
public:
ReaderException(const std::string& explanation) : _explanation("KTX deserialization error: " + explanation) {}
const char* what() const noexcept override { return _explanation.c_str(); }
const char* what() const NOEXCEPT override { return _explanation.c_str(); }
private:
const std::string _explanation;
};

View file

@ -10,13 +10,18 @@
//
#include "KTX.h"
#ifndef _MSC_VER
#define NOEXCEPT noexcept
#else
#define NOEXCEPT
#endif
namespace ktx {
class WriterException : public std::exception {
public:
WriterException(const std::string& explanation) : _explanation("KTX serialization error: " + explanation) {}
const char* what() const noexcept override { return _explanation.c_str(); }
const char* what() const NOEXCEPT override { return _explanation.c_str(); }
private:
const std::string _explanation;
};