clang-format
This commit is contained in:
parent
f350cc3a38
commit
fb58a7e8a2
@ -23,15 +23,16 @@
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
# include <io.h>
|
||||
FMT_BEGIN_NAMESPACE
|
||||
extern "C" {
|
||||
int __stdcall WriteConsoleW(void* hConsoleOutput, const void* lpBuffer, uint32_t nNumberOfCharsToWrite, uint32_t* lpNumberOfCharsWritten, void* lpReserved);
|
||||
}
|
||||
extern "C" {
|
||||
int __stdcall WriteConsoleW(void* hConsoleOutput, const void* lpBuffer,
|
||||
uint32_t nNumberOfCharsToWrite,
|
||||
uint32_t* lpNumberOfCharsWritten, void* lpReserved);
|
||||
}
|
||||
FMT_END_NAMESPACE
|
||||
#endif
|
||||
|
||||
|
||||
// Dummy implementations of strerror_r and strerror_s called if corresponding
|
||||
// system functions are not available.
|
||||
inline fmt::detail::null<> strerror_r(int, char*, ...) { return {}; }
|
||||
@ -2895,9 +2896,8 @@ FMT_FUNC void vprint(std::FILE* f, string_view format_str, format_args args) {
|
||||
if (_isatty(fd)) {
|
||||
detail::utf8_to_utf16 u16(string_view(buffer.data(), buffer.size()));
|
||||
auto written = uint32_t();
|
||||
if (!WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fd)),
|
||||
u16.c_str(), static_cast<uint32_t>(u16.size()), &written,
|
||||
nullptr)) {
|
||||
if (!WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fd)), u16.c_str(),
|
||||
static_cast<uint32_t>(u16.size()), &written, nullptr)) {
|
||||
FMT_THROW(format_error("failed to write to console"));
|
||||
}
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user