From 62b4b7af831d27769a73116381318168b1732e92 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 28 Sep 2020 13:39:31 +0300 Subject: [PATCH] Fix #1667 --- include/spdlog/sinks/msvc_sink.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/spdlog/sinks/msvc_sink.h b/include/spdlog/sinks/msvc_sink.h index f6c25acb..8fec428d 100644 --- a/include/spdlog/sinks/msvc_sink.h +++ b/include/spdlog/sinks/msvc_sink.h @@ -8,12 +8,13 @@ #include #include -#include -#include - #include #include + +// Avoid including windows.h (https://stackoverflow.com/a/30741042) +extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char *lpOutputString); + namespace spdlog { namespace sinks { /* @@ -23,12 +24,11 @@ template class msvc_sink : public base_sink { public: - explicit msvc_sink() {} + msvc_sink() = default; protected: void sink_it_(const details::log_msg &msg) override { - memory_buf_t formatted; base_sink::formatter_->format(msg, formatted); OutputDebugStringA(fmt::to_string(formatted).c_str());