From 0aa6ed46b941d384214b9a0cdf9b339bf68913c6 Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Fri, 11 Oct 2024 15:52:25 -0700 Subject: [PATCH] folly | Compile-out a constant when unused. Summary: The usage is compiled out in specific case - replicate this for the constant as well. Reviewed By: EricGriffith Differential Revision: D64053726 fbshipit-source-id: b9d8485f89d42318b933122022da7905b4418d7c --- folly/lang/Exception.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/folly/lang/Exception.cpp b/folly/lang/Exception.cpp index 2ce0e1f6475..b6ae6d20b7f 100644 --- a/folly/lang/Exception.cpp +++ b/folly/lang/Exception.cpp @@ -207,7 +207,9 @@ struct __folly_cxa_exception_with_reserve { _Unwind_Exception unwindHeader; }; +#if _LIBCPP_VERSION < 180000 || !_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION static const uint64_t kOurExceptionClass = 0x434C4E47432B2B00; // CLNGC++\0 +#endif // named differently from the real shim type __shim_type_info and all members // are pure virtual; as long as the vtable is the same, though, it should work @@ -234,7 +236,9 @@ namespace abi = __cxxabiv1; namespace __cxxabiv1 { +#if _LIBCPP_VERSION < 180000 || !_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION static const uint64_t kOurExceptionClass = 0x474E5543432B2B00; // GNUCC++\0 +#endif class __folly_shim_type_info { public: