diff options
Diffstat (limited to 'contrib/libcxxrt/memory.cc')
-rw-r--r-- | contrib/libcxxrt/memory.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/libcxxrt/memory.cc b/contrib/libcxxrt/memory.cc index 655c761..027bc3f 100644 --- a/contrib/libcxxrt/memory.cc +++ b/contrib/libcxxrt/memory.cc @@ -11,6 +11,10 @@ #include <stdlib.h> #include "stdexcept.h" +#if !__has_builtin(__sync_swap) +#define __sync_swap __sync_lock_test_and_set +#endif + namespace std { struct nothrow_t {}; @@ -33,7 +37,7 @@ namespace std __attribute__((weak)) new_handler set_new_handler(new_handler handler) { - return __sync_lock_test_and_set(&new_handl, handler); + return __sync_swap(&new_handl, handler); } } @@ -103,7 +107,7 @@ void * operator new[](size_t size) __attribute__((weak)) -void operator delete[](void * ptr) +void operator delete[](void * ptr) throw() { ::operator delete(ptr); } |