diff options
author | 2023-08-10 08:07:37 -0700 | |
---|---|---|
committer | 2023-08-10 08:08:20 -0700 | |
commit | c4ce9f74fefc9ba789ec3fb30f08c5263f71b8f4 (patch) | |
tree | 145adec48a253f34ff4f3ce65d0645f30115b5b7 | |
parent | b9a414dd3a8e99eb8f2350c746f19e4f50b25c68 (diff) |
Use the supported method for detecting RTTI in Clang:
ABSL_HAVE_FEATURE(cxx_rtti)
PiperOrigin-RevId: 555495363
Change-Id: I4f38bbffe1195ebdf26d7ed3bc92bc865dc8dd17
-rw-r--r-- | absl/base/config.h | 13 |
1 files changed, 9 insertions, 4 deletions
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 |