From c4ce9f74fefc9ba789ec3fb30f08c5263f71b8f4 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Thu, 10 Aug 2023 08:07:37 -0700 Subject: Use the supported method for detecting RTTI in Clang: ABSL_HAVE_FEATURE(cxx_rtti) PiperOrigin-RevId: 555495363 Change-Id: I4f38bbffe1195ebdf26d7ed3bc92bc865dc8dd17 --- absl/base/config.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'absl/base') diff --git a/absl/base/config.h b/absl/base/config.h index caa74787..479a5a87 100644 --- a/absl/base/config.h +++ b/absl/base/config.h @@ -837,11 +837,16 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // RTTI support. #ifdef ABSL_INTERNAL_HAS_RTTI #error ABSL_INTERNAL_HAS_RTTI cannot be directly set -#elif (defined(__GNUC__) && defined(__GXX_RTTI)) || \ - (defined(_MSC_VER) && defined(_CPPRTTI)) || \ - (!defined(__GNUC__) && !defined(_MSC_VER)) +#elif ABSL_HAVE_FEATURE(cxx_rtti) #define ABSL_INTERNAL_HAS_RTTI 1 -#endif // !defined(__GNUC__) || defined(__GXX_RTTI) +#elif defined(__GNUC__) && defined(__GXX_RTTI) +#define ABSL_INTERNAL_HAS_RTTI 1 +#elif defined(_MSC_VER) && defined(_CPPRTTI) +#define ABSL_INTERNAL_HAS_RTTI 1 +#elif !defined(__GNUC__) && !defined(_MSC_VER) +// Unknown compiler, default to RTTI +#define ABSL_INTERNAL_HAS_RTTI 1 +#endif // ABSL_INTERNAL_HAVE_SSE is used for compile-time detection of SSE support. // See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html for an overview of -- cgit v1.2.3