|
@@ -9,7 +9,6 @@
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
#include <cstdio>
|
|
|
-#include <__atomic_support>
|
|
|
|
|
|
namespace std {
|
|
|
|
|
@@ -21,13 +20,13 @@ _LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
|
|
|
unexpected_handler
|
|
|
set_unexpected(unexpected_handler func) _NOEXCEPT
|
|
|
{
|
|
|
- return __libcpp_sync_lock_test_and_set(&__unexpected_handler, func);
|
|
|
+ return __sync_lock_test_and_set(&__unexpected_handler, func);
|
|
|
}
|
|
|
|
|
|
unexpected_handler
|
|
|
get_unexpected() _NOEXCEPT
|
|
|
{
|
|
|
- return __libcpp_sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
|
|
|
+ return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -42,13 +41,14 @@ void unexpected()
|
|
|
terminate_handler
|
|
|
set_terminate(terminate_handler func) _NOEXCEPT
|
|
|
{
|
|
|
- return __libcpp_sync_lock_test_and_set(&__terminate_handler, func);
|
|
|
+ return __sync_lock_test_and_set(&__terminate_handler, func);
|
|
|
}
|
|
|
|
|
|
terminate_handler
|
|
|
get_terminate() _NOEXCEPT
|
|
|
{
|
|
|
- return __libcpp_sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
|
|
|
+ return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
#ifndef __EMSCRIPTEN__ // We provide this in JS
|