Skip to content

Commit

Permalink
Use the _MSVC_STL_UPDATE macro to detect STL
Browse files Browse the repository at this point in the history
  • Loading branch information
YexuanXiao committed Dec 17, 2024
1 parent 873670b commit 19aea79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fmt/ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class file_access {
friend auto get_file(BufType& obj) -> FILE* { return obj.*FileMemberPtr; }
};

#if FMT_MSC_VERSION
#if _MSVC_STL_UPDATE
template class file_access<file_access_tag, std::filebuf,
&std::filebuf::_Myfile>;
auto get_file(std::filebuf&) -> FILE*;
Expand Down Expand Up @@ -109,7 +109,7 @@ inline void vprint(std::ostream& os, string_view fmt, format_args args) {
auto buffer = memory_buffer();
detail::vformat_to(buffer, fmt, args);
FILE* f = nullptr;
#if FMT_MSC_VERSION && FMT_USE_RTTI
#if _MSVC_STL_UPDATE && FMT_USE_RTTI
if (auto* buf = dynamic_cast<std::filebuf*>(os.rdbuf()))
f = detail::get_file(*buf);
#elif defined(_WIN32) && defined(__GLIBCXX__) && FMT_USE_RTTI
Expand Down

0 comments on commit 19aea79

Please sign in to comment.