merged borland 6+ support from trunk.

[SVN r49190]
This commit is contained in:
Emil Dotchevski
2008-10-08 23:04:36 +00:00
parent a9b5723d0d
commit aaf8fff6fb
12 changed files with 3641 additions and 3707 deletions

View File

@ -1,38 +0,0 @@
//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
//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_F7D5662CCB0F11DCA353CAC656D89593
#define UUID_F7D5662CCB0F11DCA353CAC656D89593
#include <boost/detail/workaround.hpp>
namespace
boost
{
namespace
exception_detail
{
class clone_base;
class
cloning_base
{
public:
virtual clone_base const * clone() const = 0;
protected:
#if BOOST_WORKAROUND( __GNUC__, BOOST_TESTED_AT(4) )
virtual //Disable bogus GCC warning.
#endif
~cloning_base() throw()
{
}
};
}
}
#endif

View File

@ -1,49 +0,0 @@
//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
//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_DBA0D90C930911DCBA7B675A56D89593
#define UUID_DBA0D90C930911DCBA7B675A56D89593
#include <boost/detail/workaround.hpp>
namespace
boost
{
namespace
exception_detail
{
class
counted_base
{
friend
void
intrusive_ptr_add_ref( counted_base const * c )
{
c->add_ref();
}
friend
void
intrusive_ptr_release( counted_base const * c )
{
c->release();
}
virtual void add_ref() const=0;
virtual void release() const=0;
protected:
#if BOOST_WORKAROUND( __GNUC__, BOOST_TESTED_AT(4) )
virtual //Disable bogus GCC warning.
#endif
~counted_base() throw()
{
}
};
}
}
#endif

View File

@ -313,7 +313,8 @@ boost
exception_detail::enable_error_info_return_type<T>::type
enable_error_info( T const & x )
{
return typename exception_detail::enable_error_info_return_type<T>::type(x);
typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
return rt(x);
}
////////////////////////////////////////////////////////////////////////

View File

@ -10,7 +10,6 @@
#include <boost/exception/detail/error_info_impl.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/shared_ptr.hpp>
#include <string.h>
namespace
boost
@ -21,30 +20,20 @@ boost
struct
strwrap
{
char const * str;
std::string str;
char const * ptr;
explicit
strwrap( char const * s ):
str(init(s))
str(s),
ptr(&str[0])
{
}
~strwrap()
{
delete[] str;
}
private:
strwrap( strwrap const & );
strwrap & operator=( strwrap const & );
static
char const *
init( char const * s )
{
size_t n=1+strlen(s);
char * str = new char[n];
(void) memcpy(str,s,n);
return str;
}
};
template <>
@ -55,10 +44,10 @@ boost
shared_ptr<char const * const>
get( exception const & x )
{
if( x.throw_function_ )
if( x.throw_function_ && *x.throw_function_ )
{
shared_ptr<strwrap> s(new strwrap(x.throw_function_));
return shared_ptr<char const *>(s,&s->str);
return shared_ptr<char const *>(s,&s->ptr);
}
else
return shared_ptr<char const * const>();
@ -73,10 +62,10 @@ boost
shared_ptr<char const * const>
get( exception const & x )
{
if( x.throw_file_ )
if( x.throw_file_ && *x.throw_file_ )
{
shared_ptr<strwrap> s(new strwrap(x.throw_file_));
return shared_ptr<char const *>(s,&s->str);
return shared_ptr<char const *>(s,&s->ptr);
}
else
return shared_ptr<char const * const>();