mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02: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:
committed by
Victor Zverovich
parent
67c0c0c09c
commit
b169f5be9f
@ -1434,6 +1434,7 @@ FMT_FUNC auto vformat(string_view fmt, format_args args) -> std::string {
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
#if !defined(_WIN32) || defined(FMT_WINDOWS_NO_WCHAR)
|
#if !defined(_WIN32) || defined(FMT_WINDOWS_NO_WCHAR)
|
||||||
FMT_FUNC auto write_console(int, string_view) -> bool { return false; }
|
FMT_FUNC auto write_console(int, string_view) -> bool { return false; }
|
||||||
|
FMT_FUNC auto write_console(std::FILE*, string_view) -> bool { return false; }
|
||||||
#else
|
#else
|
||||||
using dword = conditional_t<sizeof(long) == 4, unsigned long, unsigned>;
|
using dword = conditional_t<sizeof(long) == 4, unsigned long, unsigned>;
|
||||||
extern "C" __declspec(dllimport) int __stdcall WriteConsoleW( //
|
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(),
|
return WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fd)), u16.c_str(),
|
||||||
static_cast<dword>(u16.size()), nullptr, nullptr) != 0;
|
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
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -999,6 +999,7 @@ struct is_contiguous<basic_memory_buffer<T, SIZE, Allocator>> : std::true_type {
|
|||||||
FMT_END_EXPORT
|
FMT_END_EXPORT
|
||||||
namespace detail {
|
namespace detail {
|
||||||
FMT_API auto write_console(int fd, string_view text) -> bool;
|
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);
|
FMT_API void print(std::FILE*, string_view);
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user