Skip to content

Commit

Permalink
FMT_HAS_RTTI->FMT_USE_RTTI
Browse files Browse the repository at this point in the history
  • Loading branch information
edo9300 committed May 18, 2024
1 parent bf0b77f commit 1956b6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ import std;
#endif

// Check if rtti is available.
#ifndef FMT_HAS_RTTI
#ifndef FMT_USE_RTTI
// __RTTI is for EDG compilers. _CPPRTTI is for MSVC.
# if defined(__GXX_RTTI) || FMT_HAS_FEATURE(cxx_rtti) || defined(_CPPRTTI) || \
defined(__INTEL_RTTI__) || defined(__RTTI)
# define FMT_HAS_RTTI 1
# define FMT_USE_RTTI 1
# else
# define FMT_HAS_RTTI 0
# define FMT_USE_RTTI 0
# endif
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/fmt/ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ auto get_file(std::filebuf&) -> FILE*;
inline auto write_ostream_unicode(std::ostream& os, fmt::string_view data)
-> bool {
FILE* f = nullptr;
#if FMT_MSC_VERSION && FMT_HAS_RTTI
#if FMT_MSC_VERSION && FMT_USE_RTTI
if (auto* buf = dynamic_cast<std::filebuf*>(os.rdbuf()))
f = get_file(*buf);
else
return false;
#elif defined(_WIN32) && defined(__GLIBCXX__) && FMT_HAS_RTTI
#elif defined(_WIN32) && defined(__GLIBCXX__) && FMT_USE_RTTI
auto* rdbuf = os.rdbuf();
if (auto* sfbuf = dynamic_cast<__gnu_cxx::stdio_sync_filebuf<char>*>(rdbuf))
f = sfbuf->file();
Expand Down
4 changes: 2 additions & 2 deletions include/fmt/std.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ struct formatter<
if (it == end || *it == '}') return it;
if (*it == 't') {
++it;
with_typename_ = FMT_HAS_RTTI != 0;
with_typename_ = FMT_USE_RTTI != 0;
}
return it;
}
Expand All @@ -444,7 +444,7 @@ struct formatter<
if (!with_typename_)
return detail::write_bytes<Char>(out, string_view(ex.what()));

#if FMT_HAS_RTTI
#if FMT_USE_RTTI
const std::type_info& ti = typeid(ex);
# ifdef FMT_HAS_ABI_CXA_DEMANGLE
int status = 0;
Expand Down

0 comments on commit 1956b6b

Please sign in to comment.