Commit 23807e12 authored by gabime's avatar gabime

Fixed throw macros and includes

parent 87ec1ab9
...@@ -8,6 +8,7 @@ ...@@ -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>
......
...@@ -122,7 +122,7 @@ SPDLOG_INLINE void prevent_child_fd(FILE *f) ...@@ -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);
......
...@@ -64,7 +64,7 @@ protected: ...@@ -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));
} }
} }
......
...@@ -3,6 +3,7 @@ ...@@ -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 @@ ...@@ -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>
......
...@@ -153,7 +153,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::write_to_file_(const fmt::memory ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment