summaryrefslogtreecommitdiffstats
path: root/src/new.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-10-22 18:04:00 +0000
committerdim <dim@FreeBSD.org>2012-10-22 18:04:00 +0000
commit13334223d751d249ccd6475b8cba36ff71ddc972 (patch)
tree955d27b98fe24102c3e5101aa117112b0d21ae33 /src/new.cpp
parent481a5af2380b60317ef8e4c088b58d640e46f5bc (diff)
downloadFreeBSD-src-13334223d751d249ccd6475b8cba36ff71ddc972.zip
FreeBSD-src-13334223d751d249ccd6475b8cba36ff71ddc972.tar.gz
Vendor import of libc++ trunk r165949:
http://llvm.org/svn/llvm-project/libcxx/trunk@165949
Diffstat (limited to 'src/new.cpp')
-rw-r--r--src/new.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/new.cpp b/src/new.cpp
index 1fb4b2d..3ad593a 100644
--- a/src/new.cpp
+++ b/src/new.cpp
@@ -11,6 +11,10 @@
#include "new"
+#ifndef __has_include
+#define __has_include(inc) 0
+#endif
+
#if __APPLE__
#include <cxxabi.h>
@@ -21,7 +25,12 @@
#define __new_handler __cxxabiapple::__cxa_new_handler
#endif
#else // __APPLE__
- static std::new_handler __new_handler;
+ #if defined(LIBCXXRT) || __has_include(<cxxabi.h>)
+ #include <cxxabi.h>
+ #endif // __has_include(<cxxabi.h>)
+ #ifndef _LIBCPPABI_VERSION
+ static std::new_handler __new_handler;
+ #endif // _LIBCPPABI_VERSION
#endif
// Implement all new and delete operators as weak definitions
OpenPOWER on IntegriCloud