Fixed throw macros and includes

This commit is contained in:
gabime 2019-08-19 12:13:37 +03:00
parent 87ec1ab97b
commit 23807e12e8
5 changed files with 6 additions and 3 deletions

View File

@ -8,6 +8,7 @@
#endif #endif
#include "spdlog/details/os.h" #include "spdlog/details/os.h"
#include "spdlog/common.h"
#include <cerrno> #include <cerrno>
#include <chrono> #include <chrono>

View File

@ -122,7 +122,7 @@ SPDLOG_INLINE void prevent_child_fd(FILE *f)
#if !defined(__cplusplus_winrt) #if !defined(__cplusplus_winrt)
auto file_handle = reinterpret_cast<HANDLE>(_get_osfhandle(_fileno(f))); auto file_handle = reinterpret_cast<HANDLE>(_get_osfhandle(_fileno(f)));
if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0)) if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0))
SPDLOG_THROW spdlog_ex("SetHandleInformation failed", errno); SPDLOG_THROW(spdlog_ex("SetHandleInformation failed", errno));
#endif #endif
#else #else
auto fd = fileno(f); auto fd = fileno(f);

View File

@ -64,7 +64,7 @@ protected:
if (ret < 0) if (ret < 0)
{ {
SPDLOG_THROW spdlog_ex("__android_log_write() failed", ret); SPDLOG_THROW(spdlog_ex("__android_log_write() failed", ret));
} }
} }

View File

@ -3,6 +3,7 @@
#pragma once #pragma once
#include "spdlog/common.h"
#include "spdlog/details/file_helper.h" #include "spdlog/details/file_helper.h"
#include "spdlog/details/null_mutex.h" #include "spdlog/details/null_mutex.h"
#include "spdlog/fmt/fmt.h" #include "spdlog/fmt/fmt.h"
@ -10,6 +11,7 @@
#include "spdlog/details/os.h" #include "spdlog/details/os.h"
#include "spdlog/details/synchronous_factory.h" #include "spdlog/details/synchronous_factory.h"
#include <chrono> #include <chrono>
#include <cstdio> #include <cstdio>
#include <ctime> #include <ctime>

View File

@ -153,7 +153,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::write_to_file_(const fmt::memory
bool ok = ::WriteFile(out_handle_, formatted.data() + total_written, size - total_written, &bytes_written, nullptr) != 0; bool ok = ::WriteFile(out_handle_, formatted.data() + total_written, size - total_written, &bytes_written, nullptr) != 0;
if (!ok || bytes_written == 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; total_written += bytes_written;
} while (total_written < size); } while (total_written < size);