mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 15:07:29 +02:00
macro NOEXCEPT for ktx on msvc
This commit is contained in:
parent
3a0e13387d
commit
748d7c0ce4
2 changed files with 13 additions and 2 deletions
|
@ -13,11 +13,17 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
#define NOEXCEPT noexcept
|
||||||
|
#else
|
||||||
|
#define NOEXCEPT
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace ktx {
|
namespace ktx {
|
||||||
class ReaderException: public std::exception {
|
class ReaderException: public std::exception {
|
||||||
public:
|
public:
|
||||||
ReaderException(const std::string& explanation) : _explanation("KTX deserialization error: " + explanation) {}
|
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:
|
private:
|
||||||
const std::string _explanation;
|
const std::string _explanation;
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,13 +10,18 @@
|
||||||
//
|
//
|
||||||
#include "KTX.h"
|
#include "KTX.h"
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
#define NOEXCEPT noexcept
|
||||||
|
#else
|
||||||
|
#define NOEXCEPT
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace ktx {
|
namespace ktx {
|
||||||
|
|
||||||
class WriterException : public std::exception {
|
class WriterException : public std::exception {
|
||||||
public:
|
public:
|
||||||
WriterException(const std::string& explanation) : _explanation("KTX serialization error: " + explanation) {}
|
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:
|
private:
|
||||||
const std::string _explanation;
|
const std::string _explanation;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue