diff options
author | dim <dim@FreeBSD.org> | 2015-10-05 17:47:23 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-10-05 17:47:23 +0000 |
commit | d463dc007445af010e1fa3fa6b66c3c561ef28b4 (patch) | |
tree | 7fceb2d8f3a8e174359735dd9e1ed29817dd1c21 | |
parent | c88ca1c4064bdfc5aa9a040453a2bedcab5563cf (diff) | |
download | FreeBSD-src-d463dc007445af010e1fa3fa6b66c3c561ef28b4.zip FreeBSD-src-d463dc007445af010e1fa3fa6b66c3c561ef28b4.tar.gz |
Add std::uncaught_exceptions() to libcxxrt (C++17, see N4152 and N4259).
This has also been submitted upstream.
-rw-r--r-- | contrib/libcxxrt/exception.cc | 9 | ||||
-rw-r--r-- | lib/libcxxrt/Version.map | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc index c559f97..052541f 100644 --- a/contrib/libcxxrt/exception.cc +++ b/contrib/libcxxrt/exception.cc @@ -1474,6 +1474,15 @@ namespace std return info->globals.uncaughtExceptions != 0; } /** + * Returns the number of exceptions currently being thrown that have not + * been caught. This can occur inside a nested catch statement. + */ + int uncaught_exceptions() throw() + { + __cxa_thread_info *info = thread_info(); + return info->globals.uncaughtExceptions; + } + /** * Returns the current unexpected handler. */ unexpected_handler get_unexpected() throw() diff --git a/lib/libcxxrt/Version.map b/lib/libcxxrt/Version.map index 9767542..b825eaa 100644 --- a/lib/libcxxrt/Version.map +++ b/lib/libcxxrt/Version.map @@ -356,3 +356,9 @@ GLIBCXX_3.4.9 { }; } GLIBCXX_3.4; +GLIBCXX_3.4.22 { + extern "C++" { + "std::uncaught_exceptions()"; + }; +} GLIBCXX_3.4.9; + |