summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/src/new.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-10-22 18:25:04 +0000
committerdim <dim@FreeBSD.org>2012-10-22 18:25:04 +0000
commit708d8e446e991358da23bb52ec5320440221f12f (patch)
tree3a061d75674cd5b60d9f6df45d0b8d755da3782f /contrib/libc++/src/new.cpp
parentb8c74d455d2690e710a0802a98a9d310995a52eb (diff)
parent13334223d751d249ccd6475b8cba36ff71ddc972 (diff)
downloadFreeBSD-src-708d8e446e991358da23bb52ec5320440221f12f.zip
FreeBSD-src-708d8e446e991358da23bb52ec5320440221f12f.tar.gz
Import libc++ trunk r165949. Among other improvements and bug fixes,
this has many visibility problems fixed, which should help with compiling certain ports that exercise C++11 mode (i.e. Firefox). Also, belatedly add the LICENSE.TXT and accompanying CREDITS.TXT files, which are referred to in all the source files. MFC after: 1 month
Diffstat (limited to 'contrib/libc++/src/new.cpp')
-rw-r--r--contrib/libc++/src/new.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/libc++/src/new.cpp b/contrib/libc++/src/new.cpp
index 1fb4b2d..3ad593a 100644
--- a/contrib/libc++/src/new.cpp
+++ b/contrib/libc++/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