Commit 03e73da6 by Federico Lenarduzzi Committed by Jonathan Wakely

eh_catch.cc (uncaught_exception, [...]): Return false or zero if the library is…

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
parent 913ae610
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> 2015-04-27 Ville Voutilainen <ville.voutilainen@gmail.com>
* config/abi/pre/gnu.ver: Fix comment. * config/abi/pre/gnu.ver: Fix comment.
......
...@@ -136,13 +136,21 @@ __cxxabiv1::__cxa_end_catch () ...@@ -136,13 +136,21 @@ __cxxabiv1::__cxa_end_catch ()
bool bool
std::uncaught_exception() throw() std::uncaught_exception() throw()
{ {
#if __cpp_exceptions
__cxa_eh_globals *globals = __cxa_get_globals (); __cxa_eh_globals *globals = __cxa_get_globals ();
return globals->uncaughtExceptions != 0; return globals->uncaughtExceptions != 0;
#else
return false;
#endif
} }
int int
std::uncaught_exceptions() throw() std::uncaught_exceptions() throw()
{ {
#if __cpp_exceptions
__cxa_eh_globals *globals = __cxa_get_globals (); __cxa_eh_globals *globals = __cxa_get_globals ();
return globals->uncaughtExceptions; return globals->uncaughtExceptions;
#else
return 0;
#endif
} }
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
--disable-libstdcxx-verbose and rebuilding the library. --disable-libstdcxx-verbose and rebuilding the library.
In a freestanding environment, we default to this latter approach. */ 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. */ /* The current installed user handler. */
std::terminate_handler __cxxabiv1::__terminate_handler = std::terminate_handler __cxxabiv1::__terminate_handler =
__gnu_cxx::__verbose_terminate_handler; __gnu_cxx::__verbose_terminate_handler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment