// http://www.boost.org/LICENSE_1_0.txt)
//
-#include <boost/detail/sp_typeinfo.hpp>
+#include <boost/smart_ptr/detail/sp_typeinfo_.hpp>
#include <boost/assert.hpp>
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
#include <pthread.h>
namespace boost
namespace detail
{
-class sp_counted_base
+class BOOST_SYMBOL_VISIBLE sp_counted_base
{
private:
sp_counted_base( sp_counted_base const & );
sp_counted_base & operator= ( sp_counted_base const & );
- long use_count_; // #shared
- long weak_count_; // #weak + (#shared != 0)
+ boost::int_least32_t use_count_; // #shared
+ boost::int_least32_t weak_count_; // #weak + (#shared != 0)
mutable pthread_mutex_t m_;
delete this;
}
- virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
- virtual void * get_local_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_deleter( sp_typeinfo_ const & ti ) = 0;
+ virtual void * get_local_deleter( sp_typeinfo_ const & ti ) = 0;
virtual void * get_untyped_deleter() = 0;
void add_ref_copy()
void release() // nothrow
{
BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 );
- long new_use_count = --use_count_;
+ boost::int_least32_t new_use_count = --use_count_;
BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 );
if( new_use_count == 0 )
void weak_release() // nothrow
{
BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 );
- long new_weak_count = --weak_count_;
+ boost::int_least32_t new_weak_count = --weak_count_;
BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 );
if( new_weak_count == 0 )
long use_count() const // nothrow
{
BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 );
- long r = use_count_;
+ boost::int_least32_t r = use_count_;
BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 );
return r;