From 1e7814295bfa7fae994d706ecfcd1c35895a35a7 Mon Sep 17 00:00:00 2001 From: gabi Date: Sat, 20 Dec 2014 16:24:16 +0200 Subject: [PATCH] fixed noexcept in visual studio --- include/spdlog/common.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/spdlog/common.h b/include/spdlog/common.h index daf51ceb..d10a1d3b 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -27,12 +27,21 @@ #include #include +//visual studio does not support noexcept yet +#ifndef _MSC_VER +#define SPDLOG_NOEXCEPT noexcept +#else +#define SPDLOG_NOEXCEPT +#endif + namespace spdlog { class formatter; -namespace sinks { class sink;} +namespace sinks { +class sink; +} // Common types across the lib using log_clock = std::chrono::system_clock; @@ -72,7 +81,7 @@ class spdlog_ex : public std::exception { public: spdlog_ex(const std::string& msg) :_msg(msg) {} - const char* what() const noexcept override + const char* what() const SPDLOG_NOEXCEPT override { return _msg.c_str(); }