-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
From a82712d220fc2df963c9a5463c77dd6d92ad7577 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Julian=20R=C3=BCth?= <[email protected]> | ||
Date: Tue, 2 Jan 2024 23:43:30 -0600 | ||
Subject: [PATCH] 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. | ||
--- | ||
include/fmt/format-inl.h | 5 +++++ | ||
include/fmt/format.h | 1 + | ||
2 files changed, 6 insertions(+) | ||
|
||
diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h | ||
index e9a4ca45..daeae5b1 100644 | ||
--- a/include/fmt/format-inl.h | ||
+++ b/include/fmt/format-inl.h | ||
@@ -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* f, string_view text) -> 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 | ||
diff --git a/include/fmt/format.h b/include/fmt/format.h | ||
index 97f0e1fb..7637c8a0 100644 | ||
--- a/include/fmt/format.h | ||
+++ b/include/fmt/format.h | ||
@@ -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 | ||
|
||
-- | ||
2.43.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters