[libc++] Do not redefine _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION (#177851)

Review in #176857 asked to remove this block and make
_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION similar
to the other availability macros. This patch does this.
This commit is contained in:
h-vetinari 2026-01-27 04:56:23 +11:00 committed by GitHub
parent 1d74db7e8d
commit 62339468e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 17 deletions

View File

@ -295,15 +295,6 @@
#define _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE _LIBCPP_INTRODUCED_IN_LLVM_21
// No attribute, since we've had bad_function_call::what() in the headers before
// Define availability attributes that depend on both
// _LIBCPP_HAS_EXCEPTIONS and _LIBCPP_HAS_RTTI.
#if !_LIBCPP_HAS_EXCEPTIONS || !_LIBCPP_HAS_RTTI
# undef _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
# undef _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION
# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 0
# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION
#endif
// Only define a bunch of symbols in the dylib if we need to be compatible with LLVM 7 headers or older
# if defined(_LIBCPP_BUILDING_LIBRARY) && _LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 8
# define _LIBCPP_HIDE_FROM_ABI_SINCE_LLVM8

View File

@ -31,7 +31,7 @@ _LIBCPP_PUSH_MACROS
#ifndef _LIBCPP_ABI_MICROSOFT
# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
# if _LIBCPP_HAS_EXCEPTIONS && _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
namespace __cxxabiv1 {
@ -55,9 +55,9 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception(
} // namespace __cxxabiv1
# endif
# endif // _LIBCPP_HAS_EXCEPTIONS && _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
#endif
#endif // !defined(_LIBCPP_ABI_MICROSOFT)
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
@ -113,7 +113,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _
}
# if _LIBCPP_HAS_EXCEPTIONS
# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
# if _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
template <class _Ep>
_LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit(_Ep& __e) _NOEXCEPT {
using _Ep2 = __decay_t<_Ep>;
@ -136,7 +136,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_explicit(_Ep& __e) _NOE
return current_exception();
}
}
# endif
# endif // _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
template <class _Ep>
_LIBCPP_HIDE_FROM_ABI exception_ptr __make_exception_ptr_via_throw(_Ep& __e) _NOEXCEPT {
@ -164,7 +164,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
return std::__make_exception_ptr_via_throw(__e);
}
# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION && !defined(_LIBCPP_CXX03_LANG)
# if _LIBCPP_HAS_RTTI && _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION && !defined(_LIBCPP_CXX03_LANG)
return std::__make_exception_ptr_explicit(__e);
# else
return std::__make_exception_ptr_via_throw(__e);
@ -177,7 +177,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep) _NOEXCEPT {
}
# endif // _LIBCPP_HAS_EXCEPTIONS
#else // _LIBCPP_ABI_MICROSOFT
#else // defined(_LIBCPP_ABI_MICROSOFT)
class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
_LIBCPP_DIAGNOSTIC_PUSH
@ -218,7 +218,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
return __copy_exception_ptr(std::addressof(__e), __GetExceptionInfo(__e));
}
#endif // _LIBCPP_ABI_MICROSOFT
#endif // defined(_LIBCPP_ABI_MICROSOFT)
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
_LIBCPP_POP_MACROS