diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 8208b832..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; @@ -71,8 +80,8 @@ inline const char* to_str(spdlog::level::level_enum l) class spdlog_ex : public std::exception { public: - spdlog_ex(const std::string& msg) :_msg(msg) {}; - const char* what() const throw() override + spdlog_ex(const std::string& msg) :_msg(msg) {} + const char* what() const SPDLOG_NOEXCEPT override { return _msg.c_str(); } diff --git a/include/spdlog/details/file_helper.h b/include/spdlog/details/file_helper.h index 9a045bd6..fbc48e70 100644 --- a/include/spdlog/details/file_helper.h +++ b/include/spdlog/details/file_helper.h @@ -51,7 +51,7 @@ public: explicit file_helper(bool auto_flush): _fd(nullptr), _auto_flush(auto_flush) - {}; + {} file_helper(const file_helper&) = delete; file_helper& operator=(const file_helper&) = delete; diff --git a/include/spdlog/sinks/base_sink.h b/include/spdlog/sinks/base_sink.h index a1384819..f1647ae0 100644 --- a/include/spdlog/sinks/base_sink.h +++ b/include/spdlog/sinks/base_sink.h @@ -56,7 +56,7 @@ public: { std::lock_guard lock(_mutex); _sink_it(msg); - }; + } protected: diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index b6bb5eca..0b8b36ba 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -75,7 +75,7 @@ public: void log(const details::log_msg &msg) override { ::syslog(syslog_prio_from_level(msg), "%s", msg.formatted.str().c_str()); - }; + }