diff options
author | Federico Lenarduzzi <federico.lenarduzzi@tallertechnologies.com> | 2015-04-27 21:06:17 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2015-04-27 22:06:17 +0100 |
commit | 03e73da67634e8dce1cca6b77dd9673d16226dc6 (patch) | |
tree | 0073f28f3aac478e34e0adba63e9b2123a28d939 /libstdc++-v3 | |
parent | 913ae610c20420ca47d4cb2deecac29c99e34bee (diff) | |
download | gcc-03e73da67634e8dce1cca6b77dd9673d16226dc6.zip gcc-03e73da67634e8dce1cca6b77dd9673d16226dc6.tar.gz gcc-03e73da67634e8dce1cca6b77dd9673d16226dc6.tar.bz2 |
eh_catch.cc (uncaught_exception, [...]): Return false or zero if the library is built without exceptions.
2015-04-27 Federico Lenarduzzi <federico.lenarduzzi@tallertechnologies.com>
Jonathan Wakely <jwakely@redhat.com>
* libsupc++/eh_catch.cc (uncaught_exception, uncaught_exceptions):
Return false or zero if the library is built without exceptions.
* libsupc++/eh_term_handler.cc: Disable verbose terminate handler if
the library is built without exceptions.
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r222484
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/eh_catch.cc | 8 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/eh_term_handler.cc | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a8f82bc..be9364c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2015-04-27 Federico Lenarduzzi <federico.lenarduzzi@tallertechnologies.com> + Jonathan Wakely <jwakely@redhat.com> + + * libsupc++/eh_catch.cc (uncaught_exception, uncaught_exceptions): + Return false or zero if the library is built without exceptions. + * libsupc++/eh_term_handler.cc: Disable verbose terminate handler if + the library is built without exceptions. + 2015-04-27 Ville Voutilainen <ville.voutilainen@gmail.com> * config/abi/pre/gnu.ver: Fix comment. diff --git a/libstdc++-v3/libsupc++/eh_catch.cc b/libstdc++-v3/libsupc++/eh_catch.cc index 723ae56..44fde79 100644 --- a/libstdc++-v3/libsupc++/eh_catch.cc +++ b/libstdc++-v3/libsupc++/eh_catch.cc @@ -136,13 +136,21 @@ __cxxabiv1::__cxa_end_catch () bool std::uncaught_exception() throw() { +#if __cpp_exceptions __cxa_eh_globals *globals = __cxa_get_globals (); return globals->uncaughtExceptions != 0; +#else + return false; +#endif } int std::uncaught_exceptions() throw() { +#if __cpp_exceptions __cxa_eh_globals *globals = __cxa_get_globals (); return globals->uncaughtExceptions; +#else + return 0; +#endif } diff --git a/libstdc++-v3/libsupc++/eh_term_handler.cc b/libstdc++-v3/libsupc++/eh_term_handler.cc index 46acee8..0d6ea2b 100644 --- a/libstdc++-v3/libsupc++/eh_term_handler.cc +++ b/libstdc++-v3/libsupc++/eh_term_handler.cc @@ -32,7 +32,7 @@ --disable-libstdcxx-verbose and rebuilding the library. In a freestanding environment, we default to this latter approach. */ -#if _GLIBCXX_HOSTED && _GLIBCXX_VERBOSE +#if _GLIBCXX_HOSTED && _GLIBCXX_VERBOSE && __cpp_exceptions /* The current installed user handler. */ std::terminate_handler __cxxabiv1::__terminate_handler = __gnu_cxx::__verbose_terminate_handler; |