diff --git a/BaseLib/ConfigTree.h b/BaseLib/ConfigTree.h index c222447f22299dc74e59805ced63f61ae917e740..c0ef5bbd6c42497f896f746d911f170b284d103d 100644 --- a/BaseLib/ConfigTree.h +++ b/BaseLib/ConfigTree.h @@ -526,7 +526,12 @@ private: * * This method only acts as a helper method and throws std::runtime_error. */ - [[noreturn]] void error(std::string const& message) const; +#if defined(_MSC_VER) && _MSC_VER < 1500 + __declspec(noreturn) +#else + [[noreturn]] +#endif + void error(std::string const& message) const; //! Called for printing warning messages. Will call the warning callback. //! This method only acts as a helper method. diff --git a/BaseLib/Error.h b/BaseLib/Error.h index fd5503c9d4240a833f61bf85163e7dd4873d3284..5506ab7573f359769b631b6cadca83d7614756e0 100644 --- a/BaseLib/Error.h +++ b/BaseLib/Error.h @@ -19,7 +19,12 @@ namespace BaseLib namespace detail { template <typename Msg> -[[noreturn]] bool error_impl(Msg&& msg) +#if defined(_MSC_VER) && _MSC_VER < 1500 +__declspec(noreturn) +#else +[[noreturn]] +#endif + bool error_impl(Msg&& msg) { ERR("%s", msg.data()); std::abort(); @@ -38,7 +43,12 @@ namespace BaseLib namespace detail { template <typename Msg> -[[noreturn]] bool error_impl(Msg&& msg) +#if defined(_MSC_VER) && _MSC_VER < 1500 +__declspec(noreturn) +#else +[[noreturn]] +#endif + bool error_impl(Msg&& msg) { throw std::runtime_error(std::forward<Msg>(msg)); }