From 79451368cfdc5be150b5bb6dc4bbbdc078d8cd8b Mon Sep 17 00:00:00 2001 From: gabime Date: Tue, 22 Mar 2016 00:46:41 +0200 Subject: [PATCH] Fixed issue #179 (Conflict with Boost.Asio) (by defining FMT_USE_WINDOWS_H=0 in format.h and preventing include of windows.h) --- include/spdlog/details/async_log_helper.h | 1 - include/spdlog/details/format.h | 10 ++++++++-- include/spdlog/sinks/file_sinks.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/spdlog/details/async_log_helper.h b/include/spdlog/details/async_log_helper.h index 8e9c906d..8555ef03 100644 --- a/include/spdlog/details/async_log_helper.h +++ b/include/spdlog/details/async_log_helper.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/include/spdlog/details/format.h b/include/spdlog/details/format.h index 1245b9d7..2e98d670 100644 --- a/include/spdlog/details/format.h +++ b/include/spdlog/details/format.h @@ -28,7 +28,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef FMT_FORMAT_H_ #define FMT_FORMAT_H_ -#define FMT_HEADER_ONLY //Added by spdlog for header only usage +//Added to spdlog version for header only usage +#define FMT_HEADER_ONLY + +//Added to spdlog version in order to avoid including windows.h +#if !defined (FMT_USE_WINDOWS_H) +#define FMT_USE_WINDOWS_H 0 +#endif #if defined _MSC_VER && _MSC_VER <= 1500 typedef unsigned int uint32_t; @@ -3155,7 +3161,7 @@ void BasicWriter::write_double( // MSVC's printf doesn't support 'F'. type = 'f'; #endif - // Fall through. + // Fall through. case 'E': case 'G': case 'A': diff --git a/include/spdlog/sinks/file_sinks.h b/include/spdlog/sinks/file_sinks.h index c3d214fa..d0928730 100644 --- a/include/spdlog/sinks/file_sinks.h +++ b/include/spdlog/sinks/file_sinks.h @@ -8,7 +8,7 @@ #include #include #include -#include + #include #include