Skip to content

Commit 9dbbc70

Browse files
committed
Add availability markup
1 parent 96f1f68 commit 9dbbc70

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

libcxx/include/__configuration/availability.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@
276276
#define _LIBCPP_AVAILABILITY_HAS_PMR _LIBCPP_INTRODUCED_IN_LLVM_16
277277
#define _LIBCPP_AVAILABILITY_PMR
278278

279+
// This macro controls the availability of exception_ptr::__{inc,dec}rement_refcount
280+
// which are used in the inline implementations of exception_ptr's move constructor,
281+
// assignment operator, and destructor (see libcxx/include/__exception/exception_ptr.h).
282+
#define _LIBCPP_AVAILABILITY_HAS_INCREMENT_DECREMENT_REFCOUNT_EXCEPTION_PTR _LIBCPP_INTRODUCED_IN_LLVM_21
283+
// No attribute, since we've have a fallback implementation in the headers
284+
279285
// These macros controls the availability of __cxa_init_primary_exception
280286
// in the built library, which std::make_exception_ptr might use
281287
// (see libcxx/include/__exception/exception_ptr.h).

libcxx/include/__exception/exception_ptr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
7979
_LIBCPP_HIDE_FROM_ABI exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
8080

8181
// These symbols are still exported from the library to prevent ABI breakage.
82-
# ifdef _LIBCPP_BUILDING_LIBRARY
82+
# if defined(_LIBCPP_BUILDING_LIBRARY) || !_LIBCPP_AVAILABILITY_HAS_INCREMENT_DECREMENT_REFCOUNT_EXCEPTION_PTR
8383
exception_ptr(const exception_ptr&) _NOEXCEPT;
8484
exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
8585
~exception_ptr() _NOEXCEPT;
86-
# else // _LIBCPP_BUILDING_LIBRARY
86+
# else // defined(_LIBCPP_BUILDING_LIBRARY) || !_LIBCPP_AVAILABILITY_HAS_INCREMENT_DECREMENT_REFCOUNT_EXCEPTION_PTR
8787
_LIBCPP_HIDE_FROM_ABI exception_ptr(const exception_ptr& __other) _NOEXCEPT : __ptr_(__other.__ptr_) {
8888
if (__ptr_)
8989
__increment_refcount(__ptr_);
@@ -102,7 +102,7 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
102102
if (__ptr_)
103103
__decrement_refcount(__ptr_);
104104
}
105-
# endif // _LIBCPP_BUILDING_LIBRARY
105+
# endif // defined(_LIBCPP_BUILDING_LIBRARY) || !_LIBCPP_AVAILABILITY_HAS_INCREMENT_DECREMENT_REFCOUNT_EXCEPTION_PTR
106106

107107
_LIBCPP_HIDE_FROM_ABI exception_ptr(exception_ptr&& __other) _NOEXCEPT : __ptr_(__other.__ptr_) {
108108
__other.__ptr_ = nullptr;

0 commit comments

Comments
 (0)