fix a minor compil warning

This commit is contained in:
jean-pierre charras 2023-03-05 09:16:04 +01:00
parent 667acd1149
commit 67ec09c850
1 changed files with 4 additions and 4 deletions

View File

@ -84,10 +84,10 @@ inline bool write_ostream_unicode(std::ostream& os, fmt::string_view data) {
#elif defined(_WIN32) && defined(__GLIBCXX__)
auto* rdbuf = os.rdbuf();
FILE* c_file;
if (auto* fbuf = dynamic_cast<__gnu_cxx::stdio_sync_filebuf<char>*>(rdbuf))
c_file = fbuf->file();
else if (auto* fbuf = dynamic_cast<__gnu_cxx::stdio_filebuf<char>*>(rdbuf))
c_file = fbuf->file();
if (auto* fbuf_sy = dynamic_cast<__gnu_cxx::stdio_sync_filebuf<char>*>(rdbuf))
c_file = fbuf_sy->file();
else if (auto* fbuf_as = dynamic_cast<__gnu_cxx::stdio_filebuf<char>*>(rdbuf))
c_file = fbuf_as->file();
else
return false;
if (c_file) return write_console(c_file, data);