exception.cpp (241900) | exception.cpp (246468) |
---|---|
1//===------------------------ exception.cpp -------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is dual licensed under the MIT and the University of Illinois Open 6// Source Licenses. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 19 unchanged lines hidden (view full) --- 28 #define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler 29 #endif // _LIBCPPABI_VERSION 30#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>) 31 #include <cxxabi.h> 32 using namespace __cxxabiv1; 33 #if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION) 34 #define HAVE_DEPENDENT_EH_ABI 1 35 #endif | 1//===------------------------ exception.cpp -------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is dual licensed under the MIT and the University of Illinois Open 6// Source Licenses. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 19 unchanged lines hidden (view full) --- 28 #define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler 29 #endif // _LIBCPPABI_VERSION 30#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>) 31 #include <cxxabi.h> 32 using namespace __cxxabiv1; 33 #if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION) 34 #define HAVE_DEPENDENT_EH_ABI 1 35 #endif |
36#else // __has_include(<cxxabi.h>) | 36#elif !defined(__GLIBCXX__) // __has_include(<cxxabi.h>) |
37 static std::terminate_handler __terminate_handler; 38 static std::unexpected_handler __unexpected_handler; 39#endif // __has_include(<cxxabi.h>) 40 41namespace std 42{ 43 | 37 static std::terminate_handler __terminate_handler; 38 static std::unexpected_handler __unexpected_handler; 39#endif // __has_include(<cxxabi.h>) 40 41namespace std 42{ 43 |
44#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) | 44#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__) |
45 46// libcxxrt provides implementations of these functions itself. 47unexpected_handler 48set_unexpected(unexpected_handler func) _NOEXCEPT 49{ 50 return __sync_lock_test_and_set(&__unexpected_handler, func); 51} 52 --- 41 unchanged lines hidden (view full) --- 94 { 95 // handler should not throw exception 96 ::abort (); 97 } 98#endif // _LIBCPP_NO_EXCEPTIONS 99} 100#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) 101 | 45 46// libcxxrt provides implementations of these functions itself. 47unexpected_handler 48set_unexpected(unexpected_handler func) _NOEXCEPT 49{ 50 return __sync_lock_test_and_set(&__unexpected_handler, func); 51} 52 --- 41 unchanged lines hidden (view full) --- 94 { 95 // handler should not throw exception 96 ::abort (); 97 } 98#endif // _LIBCPP_NO_EXCEPTIONS 99} 100#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) 101 |
102#ifndef LIBCXXRT | 102#if !defined(LIBCXXRT) && !defined(__GLIBCXX__) |
103bool uncaught_exception() _NOEXCEPT 104{ 105#if __APPLE__ || defined(_LIBCPPABI_VERSION) 106 // on Darwin, there is a helper function so __cxa_get_globals is private 107 return __cxa_uncaught_exception(); 108#else // __APPLE__ 109 #warning uncaught_exception not yet implemented 110 ::abort(); --- 8 unchanged lines hidden (view full) --- 119 120const char* exception::what() const _NOEXCEPT 121{ 122 return "std::exception"; 123} 124 125#endif // _LIBCPPABI_VERSION 126#endif //LIBCXXRT | 103bool uncaught_exception() _NOEXCEPT 104{ 105#if __APPLE__ || defined(_LIBCPPABI_VERSION) 106 // on Darwin, there is a helper function so __cxa_get_globals is private 107 return __cxa_uncaught_exception(); 108#else // __APPLE__ 109 #warning uncaught_exception not yet implemented 110 ::abort(); --- 8 unchanged lines hidden (view full) --- 119 120const char* exception::what() const _NOEXCEPT 121{ 122 return "std::exception"; 123} 124 125#endif // _LIBCPPABI_VERSION 126#endif //LIBCXXRT |
127#ifndef _LIBCPPABI_VERSION | 127#if !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__) |
128 129bad_exception::~bad_exception() _NOEXCEPT 130{ 131} 132 133const char* bad_exception::what() const _NOEXCEPT 134{ 135 return "std::bad_exception"; --- 89 unchanged lines hidden --- | 128 129bad_exception::~bad_exception() _NOEXCEPT 130{ 131} 132 133const char* bad_exception::what() const _NOEXCEPT 134{ 135 return "std::bad_exception"; --- 89 unchanged lines hidden --- |