forked from boostorg/exception
Compare commits
1 Commits
boost-1.52
...
boost-1.47
Author | SHA1 | Date | |
---|---|---|---|
fb47163129 |
@ -5,10 +5,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)
|
||||
|
||||
project boost/exception
|
||||
: source-location ../src
|
||||
: requirements <link>static
|
||||
;
|
||||
alias boost_exception ;
|
||||
lib boost_exception : ../src/clone_current_exception_msvc.cpp : <toolset>msvc ;
|
||||
|
||||
lib boost_exception : clone_current_exception_non_intrusive.cpp ;
|
||||
boost-install boost_exception ;
|
||||
|
@ -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
|
||||
|
@ -7,7 +7,7 @@
|
||||
#define UUID_81522C0EB56511DFAB613DB0DFD72085
|
||||
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
# error This header requires exception handling to be enabled.
|
||||
#error This header requires exception handling to be enabled.
|
||||
#endif
|
||||
|
||||
namespace
|
||||
@ -16,12 +16,6 @@ boost
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
class clone_base;
|
||||
|
||||
#ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
|
||||
int clone_current_exception_non_intrusive( clone_base const * & cloned );
|
||||
#endif
|
||||
|
||||
namespace
|
||||
clone_current_exception_result
|
||||
{
|
||||
@ -31,12 +25,15 @@ boost
|
||||
int const not_supported=3;
|
||||
}
|
||||
|
||||
class clone_base;
|
||||
int clone_current_exception_msvc_x86( clone_base const * & cloned );
|
||||
|
||||
inline
|
||||
int
|
||||
clone_current_exception( clone_base const * & cloned )
|
||||
{
|
||||
#ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
|
||||
return clone_current_exception_non_intrusive(cloned);
|
||||
#if defined(BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR) && defined(_MSC_VER) && defined(_M_IX86) && !defined(_M_X64)
|
||||
return clone_current_exception_msvc_x86(cloned);
|
||||
#else
|
||||
return clone_current_exception_result::not_supported;
|
||||
#endif
|
||||
|
@ -30,7 +30,6 @@ boost
|
||||
|
||||
protected:
|
||||
|
||||
virtual
|
||||
~error_info_base() throw()
|
||||
{
|
||||
}
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <stdexcept>
|
||||
#include <new>
|
||||
#include <ios>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace
|
||||
boost
|
||||
@ -456,13 +455,6 @@ boost
|
||||
{
|
||||
BOOST_ASSERT(p);
|
||||
p.ptr_->rethrow();
|
||||
BOOST_ASSERT(0);
|
||||
#if defined(UNDER_CE)
|
||||
// some CE platforms don't define ::abort()
|
||||
exit(-1);
|
||||
#else
|
||||
abort();
|
||||
#endif
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -3,7 +3,4 @@
|
||||
//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 Tag,class T> class error_info; }
|
||||
#endif
|
||||
|
@ -132,17 +132,7 @@ boost
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility push (default)
|
||||
# endif
|
||||
#endif
|
||||
class exception;
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility pop
|
||||
# endif
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
class shared_ptr;
|
||||
@ -310,11 +300,6 @@ boost
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility push (default)
|
||||
# endif
|
||||
#endif
|
||||
template <class T>
|
||||
struct
|
||||
error_info_injector:
|
||||
@ -331,11 +316,6 @@ 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 * );
|
||||
@ -383,11 +363,6 @@ 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
|
||||
{
|
||||
@ -401,11 +376,6 @@ boost
|
||||
{
|
||||
}
|
||||
};
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
|
||||
# pragma GCC visibility pop
|
||||
# endif
|
||||
#endif
|
||||
|
||||
inline
|
||||
void
|
||||
@ -430,15 +400,8 @@ boost
|
||||
class
|
||||
clone_impl:
|
||||
public T,
|
||||
public virtual clone_base
|
||||
public clone_base
|
||||
{
|
||||
struct clone_tag { };
|
||||
clone_impl( clone_impl const & x, clone_tag ):
|
||||
T(x)
|
||||
{
|
||||
copy_boost_exception(this,&x);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
explicit
|
||||
@ -457,7 +420,7 @@ boost
|
||||
clone_base const *
|
||||
clone() const
|
||||
{
|
||||
return new clone_impl(*this,clone_tag());
|
||||
return new clone_impl(*this);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -97,7 +97,7 @@ boost
|
||||
{
|
||||
shared_ptr<error_info_base> 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;
|
||||
}
|
||||
|
@ -18,30 +18,6 @@
|
||||
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<Tag1,T1> > const & v )
|
||||
{
|
||||
return x << v.template get<0>();
|
||||
}
|
||||
|
||||
template <
|
||||
class E,
|
||||
class Tag1,class T1,
|
||||
|
@ -1,11 +1,5 @@
|
||||
#ifndef UUID_AA15E74A856F11E08B8D93F24824019B
|
||||
#define UUID_AA15E74A856F11E08B8D93F24824019B
|
||||
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#endif
|
||||
#ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
|
||||
#define BOOST_THROW_EXCEPTION_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
@ -85,7 +79,7 @@ template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const
|
||||
set_info(
|
||||
set_info(
|
||||
set_info(
|
||||
enable_error_info(x),
|
||||
boost::enable_error_info(x),
|
||||
throw_function(current_function)),
|
||||
throw_file(file)),
|
||||
throw_line(line)));
|
||||
@ -94,7 +88,4 @@ template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const
|
||||
#endif
|
||||
} // namespace boost
|
||||
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#endif
|
||||
#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
|
||||
|
@ -10,13 +10,9 @@
|
||||
#error This file requires exception handling to be enabled.
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && defined(_M_IX86) && !defined(_M_X64)
|
||||
|
||||
#include <boost/exception/detail/clone_current_exception.hpp>
|
||||
|
||||
#if defined(BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR) && defined(_MSC_VER) && defined(_M_IX86) && !defined(_M_X64)
|
||||
|
||||
//Non-intrusive cloning support implemented below, only for MSVC versions mentioned above.
|
||||
//Thanks Anthony Williams!
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#ifndef BOOST_NO_RTTI
|
||||
@ -273,7 +269,7 @@ boost
|
||||
exception_detail
|
||||
{
|
||||
int
|
||||
clone_current_exception_non_intrusive( clone_base const * & cloned )
|
||||
clone_current_exception_msvc_x86( clone_base const * & cloned )
|
||||
{
|
||||
BOOST_ASSERT(!cloned);
|
||||
int result = clone_current_exception_result::not_supported;
|
||||
@ -296,25 +292,4 @@ boost
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
//On all other compilers, return clone_current_exception_result::not_supported.
|
||||
//On such platforms, only the intrusive enable_current_exception() cloning will work.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
int
|
||||
clone_current_exception_non_intrusive( clone_base const * & )
|
||||
{
|
||||
return clone_current_exception_result::not_supported;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -8,10 +8,12 @@
|
||||
import testing ;
|
||||
|
||||
project
|
||||
: requirements
|
||||
<link>static
|
||||
<exception-handling>on
|
||||
;
|
||||
: requirements
|
||||
<link>static
|
||||
<exception-handling>on
|
||||
<source>/boost//exception
|
||||
<define>BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
|
||||
;
|
||||
|
||||
#to_string
|
||||
|
||||
@ -40,7 +42,6 @@ run refcount_ptr_test.cpp ;
|
||||
run current_exception_cast_test.cpp ;
|
||||
run no_exceptions_test.cpp : : : <exception-handling>off ;
|
||||
run errinfos_test.cpp ;
|
||||
run exception_ptr_test.cpp/<define>BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR /boost/exception /boost//thread : : : <threading>multi : non_intrusive_exception_ptr_test ;
|
||||
run exception_ptr_test.cpp /boost//thread : : : <threading>multi ;
|
||||
|
||||
compile-fail exception_fail.cpp ;
|
||||
|
Reference in New Issue
Block a user