diff --git a/src/exceptions/BaseException.cpp b/src/exceptions/BaseException.cpp index ed28a918c..45f4a9bf8 100644 --- a/src/exceptions/BaseException.cpp +++ b/src/exceptions/BaseException.cpp @@ -18,7 +18,7 @@ namespace storm { // Intentionally left empty. } - const char* BaseException::what() const noexcept { + const char* BaseException::what() const NOEXCEPT { std::string errorString = this->stream.str(); char* result = new char[errorString.size() + 1]; result[errorString.size()] = '\0'; diff --git a/src/exceptions/BaseException.h b/src/exceptions/BaseException.h index aae0b208a..cfb97580d 100644 --- a/src/exceptions/BaseException.h +++ b/src/exceptions/BaseException.h @@ -4,6 +4,8 @@ #include #include +#include "utility/OsDetection.h" + namespace storm { namespace exceptions { @@ -39,7 +41,7 @@ namespace storm { * * @return The message associated with this exception. */ - virtual const char* what() const noexcept; + virtual const char* what() const NOEXCEPT override; protected: // This stream stores the message of this exception. diff --git a/src/utility/OsDetection.h b/src/utility/OsDetection.h index 37be3f0e7..d91d5595e 100644 --- a/src/utility/OsDetection.h +++ b/src/utility/OsDetection.h @@ -3,6 +3,7 @@ #if defined __linux__ || defined __linux # define LINUX +# define NOEXCEPT noexcept # include # include #include // Required by ErrorHandling.h @@ -12,6 +13,7 @@ # define GetCurrentDir getcwd #elif defined TARGET_OS_MAC || defined __apple__ || defined __APPLE__ # define MACOSX +# define NOEXCEPT noexcept # define _DARWIN_USE_64_BIT_INODE # include # include @@ -22,6 +24,7 @@ # define GetCurrentDir getcwd #elif defined _WIN32 || defined _WIN64 # define WINDOWS +# define NOEXCEPT throw() # ifndef NOMINMAX # define NOMINMAX # undef min