summaryrefslogtreecommitdiff
path: root/absl/base
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-10-02 10:09:34 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-10-02 10:10:25 -0700
commit302d851a06072a581961970c1e120c2af7b70482 (patch)
treeb100bf8dffd45e44b3d406741f599cbfbaff7c7f /absl/base
parent44e8609e7ee6ba85ca7bca43fdef51618a806405 (diff)
Re-submit with a fix for platforms without RTTI.
We test for `ABSL_INTERNAL_HAS_RTTI` in `absl::container_internal::TypeName` before calling `typeid`. PiperOrigin-RevId: 570101013 Change-Id: I1f2f9b2f475a6beae50d0b88718b17b296311155
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/config.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/absl/base/config.h b/absl/base/config.h
index a8425ba7..52d42f0f 100644
--- a/absl/base/config.h
+++ b/absl/base/config.h
@@ -864,6 +864,19 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#define ABSL_INTERNAL_HAS_RTTI 1
#endif
+// `ABSL_INTERNAL_HAS_CXA_DEMANGLE` determines whether `abi::__cxa_demangle` is
+// available.
+#ifdef ABSL_INTERNAL_HAS_CXA_DEMANGLE
+#error ABSL_INTERNAL_HAS_CXA_DEMANGLE cannot be directly set
+#elif defined(OS_ANDROID) && (defined(__i386__) || defined(__x86_64__))
+#define ABSL_INTERNAL_HAS_CXA_DEMANGLE 0
+#elif (__GNUC__ >= 4 || (__GNUC__ >= 3 && __GNUC_MINOR__ >= 4)) && \
+ !defined(__mips__)
+#define ABSL_INTERNAL_HAS_CXA_DEMANGLE 1
+#elif defined(__clang__) && !defined(_MSC_VER)
+#define ABSL_INTERNAL_HAS_CXA_DEMANGLE 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
// which architectures support the various x86 instruction sets.