summaryrefslogtreecommitdiff
path: root/src/new.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-10-22 18:04:00 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-10-22 18:04:00 +0000
commitea907107107132d0201e0ba377408f4e117b581c (patch)
tree955d27b98fe24102c3e5101aa117112b0d21ae33 /src/new.cpp
parent43cd7615798ea22556f20bbd64cff1e0c691e1d0 (diff)
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 1fb4b2da40d7d..3ad593a3c0e00 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