diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 1a7ce761..a0a227ef 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -30,11 +30,11 @@ #endif #if defined(__GNUC__) || defined(__clang__) -#define DEPRECATED __attribute__((deprecated)) +#define SPDLOG_DEPRECATED __attribute__((deprecated)) #elif defined(_MSC_VER) -#define DEPRECATED __declspec(deprecated) +#define SPDLOG_DEPRECATED __declspec(deprecated) #else -#define DEPRECATED +#define SPDLOG_DEPRECATED #endif diff --git a/include/spdlog/details/async_log_helper.h b/include/spdlog/details/async_log_helper.h index 14539e75..7b537361 100644 --- a/include/spdlog/details/async_log_helper.h +++ b/include/spdlog/details/async_log_helper.h @@ -82,7 +82,7 @@ async_msg(async_msg&& other) SPDLOG_NOEXCEPT: // never copy or assign. should only be moved.. async_msg(const async_msg&) = delete; - async_msg& operator=(async_msg& other) = delete; + async_msg& operator=(const async_msg& other) = delete; // construct from log_msg async_msg(const details::log_msg& m) : @@ -359,7 +359,7 @@ inline void spdlog::details::async_log_helper::sleep_or_yield(const spdlog::log_ // yield upto 150 micros if (time_since_op <= microseconds(100)) - return yield(); + return std::this_thread::yield(); // sleep for 20 ms upto 200 ms diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 763a4ad6..d468ff45 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -343,8 +343,8 @@ inline std::string errno_str(int err_num) else return "Unkown error"; -#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(ANDROID) || \ - ((_POSIX_C_SOURCE >= 200112L) && ! defined(_GNU_SOURCE)) // posix version +#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(ANDROID) || defined(__SUNPRO_CC) || \ + ((_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE) // posix version if (strerror_r(err_num, buf, buf_size) == 0) return std::string(buf); diff --git a/include/spdlog/sinks/sink.h b/include/spdlog/sinks/sink.h index d27fdbe0..fd7adfed 100644 --- a/include/spdlog/sinks/sink.h +++ b/include/spdlog/sinks/sink.h @@ -15,7 +15,10 @@ namespace sinks class sink { public: - sink(): _level( level::trace ) {} + sink() + { + _level = level::trace; + } virtual ~sink() {} virtual void log(const details::log_msg& msg) = 0;