77//
88// ===----------------------------------------------------------------------===//
99
10- #ifndef HAVE_DEPENDENT_EH_ABI
11- # error this header may only be used with libc++abi or libcxxrt
12- #endif
10+ #include < cxxabi.h>
11+ #include < exception>
1312
1413namespace std {
1514
16- exception_ptr::~exception_ptr () noexcept { __cxa_decrement_exception_refcount (__ptr_); }
15+ exception_ptr::~exception_ptr () noexcept { abi:: __cxa_decrement_exception_refcount (__ptr_); }
1716
1817exception_ptr::exception_ptr (const exception_ptr& other) noexcept : __ptr_(other.__ptr_) {
19- __cxa_increment_exception_refcount (__ptr_);
18+ abi:: __cxa_increment_exception_refcount (__ptr_);
2019}
2120
2221exception_ptr& exception_ptr::operator =(const exception_ptr& other) noexcept {
2322 if (__ptr_ != other.__ptr_ ) {
24- __cxa_increment_exception_refcount (other.__ptr_ );
25- __cxa_decrement_exception_refcount (__ptr_);
23+ abi:: __cxa_increment_exception_refcount (other.__ptr_ );
24+ abi:: __cxa_decrement_exception_refcount (__ptr_);
2625 __ptr_ = other.__ptr_ ;
2726 }
2827 return *this ;
@@ -31,7 +30,7 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept {
3130exception_ptr exception_ptr::__from_native_exception_pointer (void * __e) noexcept {
3231 exception_ptr ptr;
3332 ptr.__ptr_ = __e;
34- __cxa_increment_exception_refcount (ptr.__ptr_ );
33+ abi:: __cxa_increment_exception_refcount (ptr.__ptr_ );
3534
3635 return ptr;
3736}
@@ -51,12 +50,12 @@ exception_ptr current_exception() noexcept {
5150 // this whole function would be just:
5251 // return exception_ptr(__cxa_current_primary_exception());
5352 exception_ptr ptr;
54- ptr.__ptr_ = __cxa_current_primary_exception ();
53+ ptr.__ptr_ = abi:: __cxa_current_primary_exception ();
5554 return ptr;
5655}
5756
5857void rethrow_exception (exception_ptr p) {
59- __cxa_rethrow_primary_exception (p.__ptr_ );
58+ abi:: __cxa_rethrow_primary_exception (p.__ptr_ );
6059 // if p.__ptr_ is NULL, above returns so we terminate
6160 terminate ();
6261}
0 commit comments