summaryrefslogtreecommitdiffstats
path: root/libcxx/src/new.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/src/new.cpp')
-rw-r--r--libcxx/src/new.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp
index f2987b1f75b..dfeb5a1ac5f 100644
--- a/libcxx/src/new.cpp
+++ b/libcxx/src/new.cpp
@@ -13,14 +13,19 @@
#if __APPLE__
#include <cxxabi.h>
- // On Darwin, there are two STL shared libraries and a lower level ABI
- // shared libray. The global holding the current new handler is
- // in the ABI library and named __cxa_new_handler.
- #define __new_handler __cxxabiapple::__cxa_new_handler
+
+ #ifndef _LIBCPPABI_VERSION
+ // On Darwin, there are two STL shared libraries and a lower level ABI
+ // shared libray. The global holding the current new handler is
+ // in the ABI library and named __cxa_new_handler.
+ #define __new_handler __cxxabiapple::__cxa_new_handler
+ #endif
#else // __APPLE__
static std::new_handler __new_handler;
#endif
+#ifndef _LIBCPPABI_VERSION
+
// Implement all new and delete operators as weak definitions
// in this shared library, so that they can be overriden by programs
// that define non-weak copies of the functions.
@@ -129,11 +134,15 @@ operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
::operator delete[](ptr);
}
+#endif
+
namespace std
{
const nothrow_t nothrow = {};
+#ifndef _LIBCPPABI_VERSION
+
new_handler
set_new_handler(new_handler handler) _NOEXCEPT
{
@@ -174,6 +183,8 @@ bad_array_new_length::what() const _NOEXCEPT
return "bad_array_new_length";
}
+#endif
+
void
__throw_bad_alloc()
{
OpenPOWER on IntegriCloud