mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-30 15:32:36 +00:00
Restore symbol from 10.1
Fixes #3785. the write_console symbol has changed from 10.1 to 10.2. Here we restore the symbol as introduced in 10.1.
This commit is contained in:
parent
67c0c0c09c
commit
b169f5be9f
@ -1434,6 +1434,7 @@ FMT_FUNC auto vformat(string_view fmt, format_args args) -> std::string {
|
||||
namespace detail {
|
||||
#if !defined(_WIN32) || defined(FMT_WINDOWS_NO_WCHAR)
|
||||
FMT_FUNC auto write_console(int, string_view) -> bool { return false; }
|
||||
FMT_FUNC auto write_console(std::FILE*, string_view) -> bool { return false; }
|
||||
#else
|
||||
using dword = conditional_t<sizeof(long) == 4, unsigned long, unsigned>;
|
||||
extern "C" __declspec(dllimport) int __stdcall WriteConsoleW( //
|
||||
@ -1444,6 +1445,10 @@ FMT_FUNC bool write_console(int fd, string_view text) {
|
||||
return WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fd)), u16.c_str(),
|
||||
static_cast<dword>(u16.size()), nullptr, nullptr) != 0;
|
||||
}
|
||||
|
||||
FMT_FUNC auto write_console(std::FILE* f, string_view text) -> bool {
|
||||
return write_console(_fileno(f), text);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -999,6 +999,7 @@ struct is_contiguous<basic_memory_buffer<T, SIZE, Allocator>> : std::true_type {
|
||||
FMT_END_EXPORT
|
||||
namespace detail {
|
||||
FMT_API auto write_console(int fd, string_view text) -> bool;
|
||||
FMT_API auto write_console(std::FILE* f, string_view text) -> bool;
|
||||
FMT_API void print(std::FILE*, string_view);
|
||||
} // namespace detail
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user