From 4e39e1308550d6c30e1ef1cf9153f6032ed59a4b Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 18 Mar 2022 10:46:50 -0700 Subject: [PATCH] Remove xchar.h include from ostream.h --- include/fmt/ostream.h | 7 ++++--- test/xchar-test.cc | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index f996d43d..30c04a2d 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -11,7 +11,6 @@ #include #include "format.h" -#include "xchar.h" FMT_BEGIN_NAMESPACE @@ -141,8 +140,10 @@ void print(std::ostream& os, format_string fmt, Args&&... args) { FMT_MODULE_EXPORT template -void print(std::wostream& os, wformat_string fmt, Args&&... args) { - vprint(os, fmt, fmt::make_wformat_args(args...)); +void print(std::wostream& os, + basic_format_string...> fmt, + Args&&... args) { + vprint(os, fmt, fmt::make_format_args>(args...)); } FMT_END_NAMESPACE diff --git a/test/xchar-test.cc b/test/xchar-test.cc index 40d7fca1..4386e8b9 100644 --- a/test/xchar-test.cc +++ b/test/xchar-test.cc @@ -330,9 +330,11 @@ TEST(xchar_test, color) { } TEST(xchar_test, ostream) { +#if !FMT_GCC_VERSION || FMT_GCC_VERSION >= 409 std::wostringstream wos; fmt::print(wos, L"Don't {}!", L"panic"); - EXPECT_EQ(L"Don't panic!", wos.str()); + EXPECT_EQ(wos.str(), L"Don't panic!"); +#endif } TEST(xchar_test, to_wstring) { EXPECT_EQ(L"42", fmt::to_wstring(42)); }