macro NOEXCEPT for ktx on msvc

This commit is contained in:
Zach Pomerantz 2017-02-22 15:06:01 -05:00
parent 3a0e13387d
commit 748d7c0ce4
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;
};