aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r--libstdc++-v3/libsupc++/eh_terminate.cc13
-rw-r--r--libstdc++-v3/libsupc++/new_opnt.cc4
-rw-r--r--libstdc++-v3/libsupc++/vec.cc32
-rw-r--r--libstdc++-v3/libsupc++/vterminate.cc6
4 files changed, 28 insertions, 27 deletions
diff --git a/libstdc++-v3/libsupc++/eh_terminate.cc b/libstdc++-v3/libsupc++/eh_terminate.cc
index e03c037412a..f87f7b51d61 100644
--- a/libstdc++-v3/libsupc++/eh_terminate.cc
+++ b/libstdc++-v3/libsupc++/eh_terminate.cc
@@ -34,12 +34,13 @@ using namespace __cxxabiv1;
void
__cxxabiv1::__terminate (std::terminate_handler handler) throw ()
{
- try {
- handler ();
- std::abort ();
- } catch (...) {
- std::abort ();
- }
+ __try
+ {
+ handler ();
+ std::abort ();
+ }
+ __catch(...)
+ { std::abort (); }
}
void
diff --git a/libstdc++-v3/libsupc++/new_opnt.cc b/libstdc++-v3/libsupc++/new_opnt.cc
index 766985ee8bd..075934d7b10 100644
--- a/libstdc++-v3/libsupc++/new_opnt.cc
+++ b/libstdc++-v3/libsupc++/new_opnt.cc
@@ -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;
}
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index e44a023049e..286401cdf10 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -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;
diff --git a/libstdc++-v3/libsupc++/vterminate.cc b/libstdc++-v3/libsupc++/vterminate.cc
index 3d05df29d57..099ef180773 100644
--- a/libstdc++-v3/libsupc++/vterminate.cc
+++ b/libstdc++-v3/libsupc++/vterminate.cc
@@ -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);