blob: cc2bd0d223a9cb3d7e3cd56bbae8387ed3fa0055 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <cxxabi.h>
/**
* libc++ expects std::uncaught_exceptions() to be provided by C++ runtime library.
*
* GCC versions prior to GCC 6 did not provide this function yet, but it can be
* implemented using its API.
*
* This implementation should cover ubuntu-12, ubuntu-14, ubuntu-16.
*/
namespace std {
int uncaught_exceptions() noexcept {
const auto* globals{__cxxabiv1::__cxa_get_globals()};
return static_cast<int>(globals->uncaughtExceptions);
}
}
|