diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index 9b2ef0d8..e4cddd41 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -462,12 +462,8 @@ SPDLOG_INLINE void wstr_to_utf8buf(wstring_view_t wstr, memory_buf_t &target) return; } -#ifdef SPDLOG_USE_STD_FORMAT - int result_size = 0; -#else int result_size = static_cast(target.capacity()); if ((wstr_size + 1) * 2 > result_size) -#endif { result_size = ::WideCharToMultiByte(CP_UTF8, 0, wstr.data(), wstr_size, NULL, 0, NULL, NULL); } @@ -501,12 +497,8 @@ SPDLOG_INLINE void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target) return; } -#ifdef SPDLOG_USE_STD_FORMAT - int result_size = 0; -#else int result_size = static_cast(target.capacity()); if (str_size + 1 > result_size) -#endif { result_size = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str.data(), str_size, NULL, 0); }