From ecec210d0eb371a40758bf86d9ba62ed9ac0bdba Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Tue, 14 Nov 2017 14:21:14 +0100 Subject: [PATCH] accept msvc_sink on all compilers, add name windebug_sink (fixes #554) --- include/spdlog/sinks/msvc_sink.h | 4 ++-- include/spdlog/sinks/windebug_sink.h | 29 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 include/spdlog/sinks/windebug_sink.h diff --git a/include/spdlog/sinks/msvc_sink.h b/include/spdlog/sinks/msvc_sink.h index 6f772994..22b52c8f 100644 --- a/include/spdlog/sinks/msvc_sink.h +++ b/include/spdlog/sinks/msvc_sink.h @@ -5,12 +5,12 @@ #pragma once -#if defined(_MSC_VER) +#if defined(_WIN32) #include "base_sink.h" #include "../details/null_mutex.h" -#include +#include #include #include diff --git a/include/spdlog/sinks/windebug_sink.h b/include/spdlog/sinks/windebug_sink.h new file mode 100644 index 00000000..c22e9522 --- /dev/null +++ b/include/spdlog/sinks/windebug_sink.h @@ -0,0 +1,29 @@ +// +// Copyright(c) 2017 Alexander Dalshov. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) +// + +#pragma once + +#if defined(_WIN32) + +#include "msvc_sink.h" + +namespace spdlog +{ +namespace sinks +{ + +/* +* Windows debug sink (logging using OutputDebugStringA, synonym for msvc_sink) +*/ +template +using windebug_sink = msvc_sink; + +typedef msvc_sink_mt windebug_sink_mt; +typedef msvc_sink_st windebug_sink_st; + +} +} + +#endif