From ded661bf35b65db0be96491adbefbeed7cb8e3a3 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 8 Nov 2026 07:23:41 -0800 Subject: [PATCH] Move FMT_USE_RTTI to ostream.h Only ostream.h and std.h use it, and std.h includes ostream.h. --- include/fmt/format.h | 11 ----------- include/fmt/ostream.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 77b8df4a..7a0d02f0 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -97,17 +97,6 @@ # define FMT_INLINE_VARIABLE #endif -// Check if RTTI is disabled. -#ifdef FMT_USE_RTTI -// Use the provided definition. -#elif defined(__GXX_RTTI) || FMT_HAS_FEATURE(cxx_rtti) || defined(_CPPRTTI) || \ - defined(__INTEL_RTTI__) || defined(__RTTI) -// __RTTI is for EDG compilers. _CPPRTTI is for MSVC. -# define FMT_USE_RTTI 1 -#else -# define FMT_USE_RTTI 0 -#endif - // Visibility when compiled as a shared library/object. #if defined(FMT_LIB_EXPORT) || defined(FMT_SHARED) # define FMT_SO_VISIBILITY(value) FMT_VISIBILITY(value) diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index bf1b14c1..30e6de7f 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -30,6 +30,17 @@ # define FMT_MSVC_STL_UPDATE 0 #endif +// Check if RTTI is disabled. +#ifdef FMT_USE_RTTI +// Use the provided definition. +#elif defined(__GXX_RTTI) || FMT_HAS_FEATURE(cxx_rtti) || defined(_CPPRTTI) || \ + defined(__INTEL_RTTI__) || defined(__RTTI) +// __RTTI is for EDG compilers. _CPPRTTI is for MSVC. +# define FMT_USE_RTTI 1 +#else +# define FMT_USE_RTTI 0 +#endif + FMT_BEGIN_NAMESPACE namespace detail {