From 23807e12e8e21832aa183b133108ae888b80cb7c Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 19 Aug 2019 12:13:37 +0300 Subject: [PATCH] Fixed throw macros and includes --- include/spdlog/details/file_helper-inl.h | 1 + include/spdlog/details/os-inl.h | 2 +- include/spdlog/sinks/android_sink.h | 2 +- include/spdlog/sinks/daily_file_sink.h | 2 ++ include/spdlog/sinks/wincolor_sink-inl.h | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/spdlog/details/file_helper-inl.h b/include/spdlog/details/file_helper-inl.h index 2175ed48..891107c9 100644 --- a/include/spdlog/details/file_helper-inl.h +++ b/include/spdlog/details/file_helper-inl.h @@ -8,6 +8,7 @@ #endif #include "spdlog/details/os.h" +#include "spdlog/common.h" #include #include diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index 0e714c43..96b2b4fe 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -122,7 +122,7 @@ SPDLOG_INLINE void prevent_child_fd(FILE *f) #if !defined(__cplusplus_winrt) auto file_handle = reinterpret_cast(_get_osfhandle(_fileno(f))); if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0)) - SPDLOG_THROW spdlog_ex("SetHandleInformation failed", errno); + SPDLOG_THROW(spdlog_ex("SetHandleInformation failed", errno)); #endif #else auto fd = fileno(f); diff --git a/include/spdlog/sinks/android_sink.h b/include/spdlog/sinks/android_sink.h index bf6cd6fe..14c6ff3b 100644 --- a/include/spdlog/sinks/android_sink.h +++ b/include/spdlog/sinks/android_sink.h @@ -64,7 +64,7 @@ protected: if (ret < 0) { - SPDLOG_THROW spdlog_ex("__android_log_write() failed", ret); + SPDLOG_THROW(spdlog_ex("__android_log_write() failed", ret)); } } diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 869b4466..32cf6756 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -3,6 +3,7 @@ #pragma once +#include "spdlog/common.h" #include "spdlog/details/file_helper.h" #include "spdlog/details/null_mutex.h" #include "spdlog/fmt/fmt.h" @@ -10,6 +11,7 @@ #include "spdlog/details/os.h" #include "spdlog/details/synchronous_factory.h" + #include #include #include diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index d52b7967..e058ce7c 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -153,7 +153,7 @@ void SPDLOG_INLINE wincolor_sink::write_to_file_(const fmt::memory bool ok = ::WriteFile(out_handle_, formatted.data() + total_written, size - total_written, &bytes_written, nullptr) != 0; if (!ok || bytes_written == 0) { - SPDLOG_THROW spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError())); + SPDLOG_THROW(spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError()))); } total_written += bytes_written; } while (total_written < size);