diff options
author | theraven <theraven@FreeBSD.org> | 2011-11-26 18:46:33 +0000 |
---|---|---|
committer | theraven <theraven@FreeBSD.org> | 2011-11-26 18:46:33 +0000 |
commit | e3f9be528dde7c4a83c9e7a8baa6679993fee5c9 (patch) | |
tree | ebc9bad9ffdc334d25791808d9695bce7381a70b /contrib/libcxxrt/memory.cc | |
parent | 259c5471acdbbc6b8e0bcbda06891abebb89bdf1 (diff) | |
parent | d1f68bb7aa603f1fa1323c4198b83c0b9f330d39 (diff) | |
download | FreeBSD-src-e3f9be528dde7c4a83c9e7a8baa6679993fee5c9.zip FreeBSD-src-e3f9be528dde7c4a83c9e7a8baa6679993fee5c9.tar.gz |
Update libcxxrt to remove the pthread dependency.
Also add the license from upstream to contrib.
Approved by: dim (mentor)
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); } |