diff options
Diffstat (limited to 'contrib/libc++/src/exception.cpp')
-rw-r--r-- | contrib/libc++/src/exception.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/libc++/src/exception.cpp b/contrib/libc++/src/exception.cpp index e172f642d4830..ec8969aaf4c01 100644 --- a/contrib/libc++/src/exception.cpp +++ b/contrib/libc++/src/exception.cpp @@ -12,7 +12,8 @@ #include "exception" #include "new" -#if defined(__APPLE__) && !defined(LIBCXXRT) +#if defined(__APPLE__) && !defined(LIBCXXRT) && \ + !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) #include <cxxabi.h> using namespace __cxxabiv1; @@ -32,8 +33,8 @@ #define HAVE_DEPENDENT_EH_ABI 1 #endif #elif !defined(__GLIBCXX__) // defined(LIBCXX_BUILDING_LIBCXXABI) - static std::terminate_handler __terminate_handler; - static std::unexpected_handler __unexpected_handler; + _LIBCPP_SAFE_STATIC static std::terminate_handler __terminate_handler; + _LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler; #endif // defined(LIBCXX_BUILDING_LIBCXXABI) namespace std @@ -106,7 +107,8 @@ bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; } int uncaught_exceptions() _NOEXCEPT { -#if defined(__APPLE__) || defined(_LIBCPPABI_VERSION) +#if !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) && \ + (defined(__APPLE__) || defined(_LIBCPPABI_VERSION)) // on Darwin, there is a helper function so __cxa_get_globals is private # if _LIBCPPABI_VERSION > 1101 return __cxa_uncaught_exceptions(); |