eh_terminate.cc: Fixes for -fno-exceptions.

2009-09-28  Benjamin Kosnik  <bkoz@redhat.com>

	*  libsupc++/eh_terminate.cc: Fixes for -fno-exceptions.
	*  libsupc++/vec.cc: Same.
	*  libsupc++/vterminate.cc: Same.
	*  libsupc++/new_opnt.cc: Same.

From-SVN: r152258
This commit is contained in:
Benjamin Kosnik 2009-09-29 00:15:30 +00:00
parent b80b0fd9c7
commit bbcfe54a2d
5 changed files with 218 additions and 210 deletions

View File

@ -1,3 +1,10 @@
2009-09-28 Benjamin Kosnik <bkoz@redhat.com>
* libsupc++/eh_terminate.cc: Fixes for -fno-exceptions.
* libsupc++/vec.cc: Same.
* libsupc++/vterminate.cc: Same.
* libsupc++/new_opnt.cc: Same.
2009-09-28 Johannes Singler <singler@ira.uka.de>
* include/parallel/for_each_selectors.h: Remove obsolete comment.

View File

@ -34,12 +34,13 @@ using namespace __cxxabiv1;
void
__cxxabiv1::__terminate (std::terminate_handler handler) throw ()
{
try {
__try
{
handler ();
std::abort ();
} catch (...) {
std::abort ();
}
__catch(...)
{ std::abort (); }
}
void

View File

@ -47,11 +47,11 @@ operator new (std::size_t sz, const std::nothrow_t&) throw()
new_handler handler = __new_handler;
if (! handler)
return 0;
try
__try
{
handler ();
}
catch (bad_alloc &)
__catch(const bad_alloc&)
{
return 0;
}

View File

@ -95,12 +95,12 @@ namespace __cxxabiv1
reinterpret_cast <std::size_t *> (base)[-2] = element_size;
#endif
}
try
__try
{
__cxa_vec_ctor(base, element_count, element_size,
constructor, destructor);
}
catch (...)
__catch(...)
{
{
uncatch_exception ue;
@ -136,12 +136,12 @@ namespace __cxxabiv1
reinterpret_cast <std::size_t *> (base)[-2] = element_size;
#endif
}
try
__try
{
__cxa_vec_ctor(base, element_count, element_size,
constructor, destructor);
}
catch (...)
__catch(...)
{
{
uncatch_exception ue;
@ -164,13 +164,13 @@ namespace __cxxabiv1
std::size_t ix = 0;
char *ptr = static_cast<char *>(array_address);
try
__try
{
if (constructor)
for (; ix != element_count; ix++, ptr += element_size)
constructor(ptr);
}
catch (...)
__catch(...)
{
{
uncatch_exception ue;
@ -194,14 +194,14 @@ namespace __cxxabiv1
char *dest_ptr = static_cast<char *>(dest_array);
char *src_ptr = static_cast<char *>(src_array);
try
__try
{
if (constructor)
for (; ix != element_count;
ix++, src_ptr += element_size, dest_ptr += element_size)
constructor(dest_ptr, src_ptr);
}
catch (...)
__catch(...)
{
{
uncatch_exception ue;
@ -226,7 +226,7 @@ namespace __cxxabiv1
ptr += element_count * element_size;
try
__try
{
while (ix--)
{
@ -234,7 +234,7 @@ namespace __cxxabiv1
destructor(ptr);
}
}
catch (...)
__catch(...)
{
{
uncatch_exception ue;
@ -261,7 +261,7 @@ namespace __cxxabiv1
ptr += element_count * element_size;
try
__try
{
while (ix--)
{
@ -269,7 +269,7 @@ namespace __cxxabiv1
destructor(ptr);
}
}
catch (...)
__catch(...)
{
std::terminate();
}
@ -304,12 +304,12 @@ namespace __cxxabiv1
{
std::size_t element_count = reinterpret_cast<std::size_t *>(base)[-1];
base -= padding_size;
try
__try
{
__cxa_vec_dtor(array_address, element_count, element_size,
destructor);
}
catch (...)
__catch(...)
{
{
uncatch_exception ue;
@ -339,12 +339,12 @@ namespace __cxxabiv1
std::size_t element_count = reinterpret_cast<std::size_t *> (base)[-1];
base -= padding_size;
size = element_count * element_size + padding_size;
try
__try
{
__cxa_vec_dtor(array_address, element_count, element_size,
destructor);
}
catch (...)
__catch(...)
{
{
uncatch_exception ue;

View File

@ -75,9 +75,9 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// If the exception is derived from std::exception, we can
// give more information.
try { __throw_exception_again; }
__try { __throw_exception_again; }
#ifdef __EXCEPTIONS
catch (exception &exc)
__catch(const exception& exc)
{
char const *w = exc.what();
fputs(" what(): ", stderr);
@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
fputs("\n", stderr);
}
#endif
catch (...) { }
__catch(...) { }
}
else
fputs("terminate called without an active exception\n", stderr);