Fix for non-Windows OSs
This commit is contained in:
parent
fe2e381de5
commit
4230d7481e
@ -921,7 +921,9 @@ struct is_contiguous<basic_memory_buffer<T, SIZE, Allocator>> : std::true_type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
#ifdef _WIN32
|
||||||
bool write_console_on_windows(std::FILE* f, string_view text);
|
bool write_console_on_windows(std::FILE* f, string_view text);
|
||||||
|
#endif
|
||||||
FMT_API void print(std::FILE*, string_view);
|
FMT_API void print(std::FILE*, string_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -87,8 +87,10 @@ template class filebuf_access<filebuf_access_tag,
|
|||||||
|
|
||||||
inline bool write_ostream_msvc_unicode(std::ostream& os,
|
inline bool write_ostream_msvc_unicode(std::ostream& os,
|
||||||
fmt::string_view data) {
|
fmt::string_view data) {
|
||||||
|
#ifdef _WIN32
|
||||||
if (auto* buf = dynamic_cast<std::filebuf*>(os.rdbuf()))
|
if (auto* buf = dynamic_cast<std::filebuf*>(os.rdbuf()))
|
||||||
if (FILE* f = get_file(*buf)) return write_console_on_windows(f, data);
|
if (FILE* f = get_file(*buf)) return write_console_on_windows(f, data);
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
inline bool write_ostream_msvc_unicode(std::wostream&,
|
inline bool write_ostream_msvc_unicode(std::wostream&,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user