From bb4dd8289b351fae6b55e303f189127a394a1edd Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 26 Aug 2013 08:15:55 -0400 Subject: Imported Upstream version 1.51.0 --- boost/exception/detail/attribute_noreturn.hpp | 2 +- boost/exception/detail/error_info_impl.hpp | 1 + boost/exception/detail/exception_ptr.hpp | 9 ++++++-- boost/exception/error_info.hpp | 3 +++ boost/exception/exception.hpp | 31 +++++++++++++++++++++++++-- boost/exception/info.hpp | 2 +- boost/exception/info_tuple.hpp | 24 +++++++++++++++++++++ 7 files changed, 66 insertions(+), 6 deletions(-) (limited to 'boost/exception') diff --git a/boost/exception/detail/attribute_noreturn.hpp b/boost/exception/detail/attribute_noreturn.hpp index f6a0b5903e..ae9f031efe 100644 --- a/boost/exception/detail/attribute_noreturn.hpp +++ b/boost/exception/detail/attribute_noreturn.hpp @@ -9,7 +9,7 @@ #if defined(_MSC_VER) #define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn) #elif defined(__GNUC__) -#define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn)) +#define BOOST_ATTRIBUTE_NORETURN __attribute__((__noreturn__)) #else #define BOOST_ATTRIBUTE_NORETURN #endif diff --git a/boost/exception/detail/error_info_impl.hpp b/boost/exception/detail/error_info_impl.hpp index 883d313a98..a8d1aa79dd 100644 --- a/boost/exception/detail/error_info_impl.hpp +++ b/boost/exception/detail/error_info_impl.hpp @@ -30,6 +30,7 @@ boost protected: + virtual ~error_info_base() throw() { } diff --git a/boost/exception/detail/exception_ptr.hpp b/boost/exception/detail/exception_ptr.hpp index b6ccf7e18c..5e5a2679b8 100644 --- a/boost/exception/detail/exception_ptr.hpp +++ b/boost/exception/detail/exception_ptr.hpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace boost @@ -457,7 +457,12 @@ boost BOOST_ASSERT(p); p.ptr_->rethrow(); BOOST_ASSERT(0); - std::abort(); + #if defined(UNDER_CE) + // some CE platforms don't define ::abort() + exit(-1); + #else + abort(); + #endif } inline diff --git a/boost/exception/error_info.hpp b/boost/exception/error_info.hpp index 2e6832a338..03b3da8e31 100644 --- a/boost/exception/error_info.hpp +++ b/boost/exception/error_info.hpp @@ -3,4 +3,7 @@ //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef UUID_EE7ECCA0433B11E1923E37064924019B +#define UUID_EE7ECCA0433B11E1923E37064924019B namespace boost { template class error_info; } +#endif diff --git a/boost/exception/exception.hpp b/boost/exception/exception.hpp index 9cdfd5c6e8..42d2787128 100644 --- a/boost/exception/exception.hpp +++ b/boost/exception/exception.hpp @@ -310,6 +310,11 @@ boost namespace exception_detail { +#if defined(__GNUC__) +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# pragma GCC visibility push (default) +# endif +#endif template struct error_info_injector: @@ -326,6 +331,11 @@ boost { } }; +#if defined(__GNUC__) +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# pragma GCC visibility pop +# endif +#endif struct large_size { char c[256]; }; large_size dispatch_boost_exception( exception const * ); @@ -373,6 +383,11 @@ boost namespace exception_detail { +#if defined(__GNUC__) +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# pragma GCC visibility push (default) +# endif +#endif class clone_base { @@ -386,6 +401,11 @@ boost { } }; +#if defined(__GNUC__) +# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) +# pragma GCC visibility pop +# endif +#endif inline void @@ -410,8 +430,15 @@ boost class clone_impl: public T, - public clone_base + public virtual clone_base { + struct clone_tag { }; + clone_impl( clone_impl const & x, clone_tag ): + T(x) + { + copy_boost_exception(this,&x); + } + public: explicit @@ -430,7 +457,7 @@ boost clone_base const * clone() const { - return new clone_impl(*this); + return new clone_impl(*this,clone_tag()); } void diff --git a/boost/exception/info.hpp b/boost/exception/info.hpp index 5530746223..7b56076d7b 100644 --- a/boost/exception/info.hpp +++ b/boost/exception/info.hpp @@ -97,7 +97,7 @@ boost { shared_ptr const & p = i->second; #ifndef BOOST_NO_RTTI - BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==ti.type_ ); + BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ ); #endif return p; } diff --git a/boost/exception/info_tuple.hpp b/boost/exception/info_tuple.hpp index 34afe421b1..bf1be15da2 100644 --- a/boost/exception/info_tuple.hpp +++ b/boost/exception/info_tuple.hpp @@ -18,6 +18,30 @@ namespace boost { + template < + class E > + inline + E const & + operator<<( + E const & x, + tuple< > const & v ) + { + return x; + } + + template < + class E, + class Tag1,class T1 > + inline + E const & + operator<<( + E const & x, + tuple< + error_info > const & v ) + { + return x << v.template get<0>(); + } + template < class E, class Tag1,class T1, -- cgit v1.2.3