aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2009-08-10 18:24:47 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2009-08-10 18:24:47 +0000
commit8d1b99e26ad5c88a05c7c7ba2fbb05bdc345e9d2 (patch)
tree230597b4bbde6bf2acfd8a8a8dea94ffdc056bd0 /libstdc++-v3/src
parent35076532472d49156e476529d846466a53d989c9 (diff)
downloadgcc-8d1b99e26ad5c88a05c7c7ba2fbb05bdc345e9d2.zip
gcc-8d1b99e26ad5c88a05c7c7ba2fbb05bdc345e9d2.tar.gz
gcc-8d1b99e26ad5c88a05c7c7ba2fbb05bdc345e9d2.tar.bz2
future: Fixes for -fno-exceptions.
2009-08-10 Benjamin Kosnik <bkoz@redhat.com> * include/std/future: Fixes for -fno-exceptions. * include/bits/functexcept.h: Same. * libsupc++/exception_ptr.h: Same. * src/pool_allocator.cc: Same. * src/future.cc: Same. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: New exports. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Same. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Same. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Same. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Same. * testsuite/30_threads/promise/cons/assign_neg.cc: Same. * testsuite/30_threads/promise/cons/copy_neg.cc: Same. * testsuite/23_containers/deque/operators/1.cc: Separate in two... * testsuite/23_containers/deque/operators/2.cc: New. From-SVN: r150633
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/functexcept.cc15
-rw-r--r--libstdc++-v3/src/future.cc5
-rw-r--r--libstdc++-v3/src/pool_allocator.cc4
3 files changed, 20 insertions, 4 deletions
diff --git a/libstdc++-v3/src/functexcept.cc b/libstdc++-v3/src/functexcept.cc
index 057c037..352a6b7 100644
--- a/libstdc++-v3/src/functexcept.cc
+++ b/libstdc++-v3/src/functexcept.cc
@@ -24,10 +24,11 @@
#include <cstdlib>
#include <exception>
#include <stdexcept>
-#include <system_error>
#include <new>
#include <typeinfo>
#include <ios>
+#include <system_error>
+#include <future>
#ifdef _GLIBCXX_USE_NLS
# include <libintl.h>
@@ -98,6 +99,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
void
__throw_system_error(int __i)
{ throw system_error(error_code(__i, generic_category())); }
+
+ void
+ __throw_future_error(int __i)
+ { throw future_error(future_errc(__i)); }
+
#else
void
__throw_bad_exception(void)
@@ -156,8 +162,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ std::abort(); }
void
- __throw_system_error(int __i)
+ __throw_system_error(int)
{ std::abort(); }
+
+ void
+ __throw_future_error(int)
+ { std::abort(); }
+
#endif //__EXCEPTIONS
_GLIBCXX_END_NAMESPACE
diff --git a/libstdc++-v3/src/future.cc b/libstdc++-v3/src/future.cc
index ab9d5db..f4ef785 100644
--- a/libstdc++-v3/src/future.cc
+++ b/libstdc++-v3/src/future.cc
@@ -67,6 +67,11 @@ namespace
namespace std
{
const error_category* const future_category = &__future_category_instance();
+
+ future_error::~future_error() throw() { }
+
+ const char*
+ future_error::what() const throw() { return _M_code.message().c_str(); }
}
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
diff --git a/libstdc++-v3/src/pool_allocator.cc b/libstdc++-v3/src/pool_allocator.cc
index e0da5e7..ebaa394 100644
--- a/libstdc++-v3/src/pool_allocator.cc
+++ b/libstdc++-v3/src/pool_allocator.cc
@@ -90,11 +90,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
size_t __bytes_to_get = (2 * __total_bytes
+ _M_round_up(_S_heap_size >> 4));
- try
+ __try
{
_S_start_free = static_cast<char*>(::operator new(__bytes_to_get));
}
- catch (...)
+ __catch (...)
{
// Try to make do with what we have. That can't hurt. We
// do not try smaller requests, since that tends to result