Some libcxxrt-compatibility cleanups (avoid defining things twice).
llvm-svn: 151717
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: e1da544e0bc73a39a8d519f8b68fc80467fb7d6d
diff --git a/src/new.cpp b/src/new.cpp
index 11d7be6..1c171a8 100644
--- a/src/new.cpp
+++ b/src/new.cpp
@@ -24,7 +24,7 @@
static std::new_handler __new_handler;
#endif
-//#ifndef _LIBCPPABI_VERSION
+#if !defined (LIBCXXRT) // && !defined(_LIBCPPABI_VERSION)
// Implement all new and delete operators as weak definitions
// in this shared library, so that they can be overriden by programs
@@ -134,7 +134,7 @@
::operator delete[](ptr);
}
-//#endif // _LIBCPPABI_VERSION
+#endif // !_LIBCPPABI_VERSION && !LIBCXXRT
namespace std
{
@@ -155,6 +155,8 @@
return __sync_fetch_and_add(&__new_handler, (new_handler)0);
}
+#ifndef LIBCXXRT
+
bad_alloc::bad_alloc() _NOEXCEPT
{
}
@@ -184,6 +186,7 @@
}
#endif
+#endif //LIBCXXRT
void
__throw_bad_alloc()