From 2fa538779f8d69a3b20958ddf6dab7885ff030ac Mon Sep 17 00:00:00 2001 From: gabime Date: Thu, 4 Oct 2018 02:20:47 +0300 Subject: [PATCH] Fixed static_assert --- include/spdlog/details/logger_impl.h | 2 +- include/spdlog/logger.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index 6b12a4dd..27f0eb46 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -175,7 +175,7 @@ inline void spdlog::logger::critical(const T &msg) } #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT -static_assert(_WIN32, "SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows"); + inline void wbuf_to_utf8buf(const fmt::wmemory_buffer &wbuf, fmt::memory_buffer &target) { int wbuf_size = static_cast(wbuf.size()); diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 18496bce..13ef910f 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -68,6 +68,9 @@ public: void critical(const char *fmt, const Args &... args); #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT +#ifndef _WIN32 +#error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows +#else template void log(level::level_enum lvl, const wchar_t *fmt, const Args &... args); @@ -88,6 +91,7 @@ public: template void critical(const wchar_t *fmt, const Args &... args); +#endif // _WIN32 #endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT template