diff --git a/include/tables/TableKeyNotDefinedException.h b/include/tables/TableKeyNotDefinedException.h index a99ba9409f..8f318ba72c 100644 --- a/include/tables/TableKeyNotDefinedException.h +++ b/include/tables/TableKeyNotDefinedException.h @@ -11,6 +11,12 @@ #include #include "llvm/StringRef.h" +#if defined(_MSC_VER) + #define NT_NOEXCEPT throw() +#else + #define NT_NOEXCEPT noexcept +#endif + /** * An exception thrown when the lookup a a key-value fails in a {@link ITable} */ @@ -20,8 +26,8 @@ class TableKeyNotDefinedException : public std::exception { * @param key the key that was not defined in the table */ TableKeyNotDefinedException(llvm::StringRef key); - ~TableKeyNotDefinedException() noexcept; - const char* what() const noexcept override; + ~TableKeyNotDefinedException() NT_NOEXCEPT; + const char* what() const NT_NOEXCEPT override; private: std::string msg; diff --git a/src/tables/TableKeyNotDefinedException.cpp b/src/tables/TableKeyNotDefinedException.cpp index 31eb8b346d..30bedd0936 100644 --- a/src/tables/TableKeyNotDefinedException.cpp +++ b/src/tables/TableKeyNotDefinedException.cpp @@ -12,8 +12,8 @@ TableKeyNotDefinedException::TableKeyNotDefinedException(llvm::StringRef key) msg += key; } -const char* TableKeyNotDefinedException::what() const noexcept { +const char* TableKeyNotDefinedException::what() const NT_NOEXCEPT { return msg.c_str(); } -TableKeyNotDefinedException::~TableKeyNotDefinedException() noexcept {} +TableKeyNotDefinedException::~TableKeyNotDefinedException() NT_NOEXCEPT {}