diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-02-02 20:48:35 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-02-02 20:48:35 +0000 |
commit | 2c9c6a579a8f3d4f7c65b8073ef8fc6a64a7fa76 (patch) | |
tree | 74fee64b859f617f9f7e4a78f5c93ddfa509ad97 /libcxx/src/exception.cpp | |
parent | eaa65afc7bff75649cab2a4be4ce18f82554db5b (diff) | |
download | bcm5719-llvm-2c9c6a579a8f3d4f7c65b8073ef8fc6a64a7fa76.tar.gz bcm5719-llvm-2c9c6a579a8f3d4f7c65b8073ef8fc6a64a7fa76.zip |
Prepare for running on top of new libc++abi.
llvm-svn: 149634
Diffstat (limited to 'libcxx/src/exception.cpp')
-rw-r--r-- | libcxx/src/exception.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libcxx/src/exception.cpp b/libcxx/src/exception.cpp index 26d97a96082..40327d6a07d 100644 --- a/libcxx/src/exception.cpp +++ b/libcxx/src/exception.cpp @@ -12,14 +12,17 @@ #if __APPLE__ #include <cxxabi.h> + using namespace __cxxabiv1; - using namespace __cxxabiapple; - // On Darwin, there are two STL shared libraries and a lower level ABI - // shared libray. The globals holding the current terminate handler and - // current unexpected handler are in the ABI library. - #define __terminate_handler __cxxabiapple::__cxa_terminate_handler - #define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler #define HAVE_DEPENDENT_EH_ABI 1 + #ifndef _LIBCPPABI_VERSION + using namespace __cxxabiapple; + // On Darwin, there are two STL shared libraries and a lower level ABI + // shared libray. The globals holding the current terminate handler and + // current unexpected handler are in the ABI library. + #define __terminate_handler __cxxabiapple::__cxa_terminate_handler + #define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler + #endif // _LIBCPPABI_VERSION #elif defined(LIBCXXRT) #include <cxxabi.h> using namespace __cxxabiv1; @@ -29,7 +32,8 @@ static std::unexpected_handler __unexpected_handler; #endif // __APPLE__ -#ifndef LIBCXXRT +#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) + // libcxxrt provides implementations of these functions itself. std::unexpected_handler std::set_unexpected(std::unexpected_handler func) _NOEXCEPT @@ -84,13 +88,13 @@ std::terminate() _NOEXCEPT } #endif // _LIBCPP_NO_EXCEPTIONS } -#endif // LIBCXXRT +#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) bool std::uncaught_exception() _NOEXCEPT { #if __APPLE__ // on Darwin, there is a helper function so __cxa_get_globals is private - return __cxxabiapple::__cxa_uncaught_exception(); + return __cxa_uncaught_exception(); #elif LIBCXXRT __cxa_eh_globals * globals = __cxa_get_globals(); return (globals->uncaughtExceptions != 0); @@ -103,6 +107,8 @@ bool std::uncaught_exception() _NOEXCEPT namespace std { +#ifndef _LIBCPPABI_VERSION + exception::~exception() _NOEXCEPT { } @@ -121,6 +127,8 @@ const char* bad_exception::what() const _NOEXCEPT return "std::bad_exception"; } +#endif // _LIBCPPABI_VERSION + exception_ptr::~exception_ptr() _NOEXCEPT { #if HAVE_DEPENDENT_EH_ABI |