Fix for non-Windows OSs

This commit is contained in:
Dimitrij Mijoski 2022-07-20 21:24:24 +02:00
parent fe2e381de5
commit 4230d7481e
2 changed files with 4 additions and 0 deletions

View File

@ -921,7 +921,9 @@ struct is_contiguous<basic_memory_buffer<T, SIZE, Allocator>> : std::true_type {
};
namespace detail {
#ifdef _WIN32
bool write_console_on_windows(std::FILE* f, string_view text);
#endif
FMT_API void print(std::FILE*, string_view);
}

View File

@ -87,8 +87,10 @@ template class filebuf_access<filebuf_access_tag,
inline bool write_ostream_msvc_unicode(std::ostream& os,
fmt::string_view data) {
#ifdef _WIN32
if (auto* buf = dynamic_cast<std::filebuf*>(os.rdbuf()))
if (FILE* f = get_file(*buf)) return write_console_on_windows(f, data);
#endif
return false;
}
inline bool write_ostream_msvc_unicode(std::wostream&,