Fixed gcc compilation errors

[SVN r37751]
This commit is contained in:
Ion Gaztañaga
2007-05-23 16:14:00 +00:00
parent 5898cc181d
commit 38773b309d
5 changed files with 24 additions and 54 deletions

View File

@@ -132,12 +132,6 @@
<File
RelativePath="..\..\..\..\boost\interprocess\smart_ptr\detail\sp_counted_base_atomic.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\interprocess\smart_ptr\detail\sp_counted_base_pt.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\interprocess\smart_ptr\detail\sp_counted_base_w32.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\interprocess\smart_ptr\detail\sp_counted_impl.hpp">
</File>

View File

@@ -15,7 +15,6 @@
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/config.hpp>
#include <algorithm>
#include <functional>
@@ -45,7 +44,7 @@ class base
{
private:
boost::detail::atomic_count use_count_;
int use_count_;
base(base const &);
base & operator=(base const &);
@@ -67,22 +66,6 @@ class base
return use_count_;
}
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
inline friend void intrusive_ptr_add_ref
(base * p)
{
++p->use_count_;
}
inline friend void intrusive_ptr_release
(base * p)
{
if(--p->use_count_ == 0) delete p;
}
#else
void add_ref()
{
++use_count_;
@@ -92,17 +75,10 @@ class base
{
if(--use_count_ == 0) delete this;
}
#endif
};
} // namespace N
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
namespace boost
{
inline void intrusive_ptr_add_ref
(const boost::interprocess::offset_ptr<N::base> &p)
{
@@ -115,12 +91,6 @@ inline void intrusive_ptr_release
p->release();
}
} // namespace boost
#endif
//
struct X: public virtual N::base
{
};
@@ -181,9 +151,6 @@ void pointer_constructor()
boost::interprocess::offset_ptr<X> p = new X;
BOOST_TEST(p->use_count() == 0);
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
using boost::intrusive_ptr_add_ref;
#endif
intrusive_ptr_add_ref(get_pointer(p));
BOOST_TEST(p->use_count() == 1);

View File

@@ -29,7 +29,7 @@ template<bool DoublyLinked>
struct push_data_function
{
template<class MyShmList, class MyStdList>
int operator()(int max, MyShmList *shmlist, MyStdList *stdlist) const
static int execute(int max, MyShmList *shmlist, MyStdList *stdlist)
{
typedef typename MyShmList::value_type IntType;
for(int i = 0; i < max; ++i){
@@ -46,7 +46,7 @@ template<>
struct push_data_function<false>
{
template<class MyShmList, class MyStdList>
int operator()(int max, MyShmList *shmlist, MyStdList *stdlist) const
static int execute(int max, MyShmList *shmlist, MyStdList *stdlist)
{
typedef typename MyShmList::value_type IntType;
for(int i = 0; i < max; ++i){
@@ -63,7 +63,7 @@ template<bool DoublyLinked>
struct pop_back_function
{
template<class MyStdList, class MyShmList>
int operator()(MyShmList *shmlist, MyStdList *stdlist) const
static int execute(MyShmList *shmlist, MyStdList *stdlist)
{
shmlist->pop_back();
stdlist->pop_back();
@@ -76,7 +76,7 @@ template<>
struct pop_back_function<false>
{
template<class MyStdList, class MyShmList>
int operator()(MyShmList *shmlist, MyStdList *stdlist) const
static int execute(MyShmList *shmlist, MyStdList *stdlist)
{
(void)shmlist; (void)stdlist;
return 0;
@@ -84,7 +84,6 @@ struct pop_back_function<false>
};
template<class ManagedSharedMemory
,class MyShmList
,bool DoublyLinked>
@@ -112,7 +111,19 @@ int list_test (bool copied_allocators_equal = true)
MyStdList *stdlist = new MyStdList;
if(push_data_t()(max, shmlist, stdlist)){
/*
{
typedef typename MyShmList::value_type IntType;
for(int i = 0; i < max; ++i){
IntType move_me(i);
shmlist->push_front(move(move_me));
stdlist->push_front(i);
}
if(!CheckEqualContainers(shmlist, stdlist)) return 1;
return 0;
}*/
if(push_data_t::execute(max, shmlist, stdlist)){
return 1;
}
@@ -120,7 +131,7 @@ int list_test (bool copied_allocators_equal = true)
stdlist->erase(stdlist->begin()++);
if(!CheckEqualContainers(shmlist, stdlist)) return 1;
if(pop_back_function<DoublyLinked>()(shmlist, stdlist)){
if(pop_back_function<DoublyLinked>::execute(shmlist, stdlist)){
return 1;
}
@@ -188,7 +199,7 @@ int list_test (bool copied_allocators_equal = true)
stdlist->resize(stdlist->size()/2);
if(!CheckEqualContainers(shmlist, stdlist)) return 1;
if(push_data_t()(max, shmlist, stdlist)){
if(push_data_t::execute(max, shmlist, stdlist)){
return 1;
}
@@ -197,7 +208,7 @@ int list_test (bool copied_allocators_equal = true)
int listsize = (int)shmlist->size();
if(push_data_t()(listsize, shmlist, stdlist)){
if(push_data_t::execute(listsize, shmlist, stdlist)){
return 1;
}
@@ -209,11 +220,11 @@ int list_test (bool copied_allocators_equal = true)
listsize = (int)shmlist->size();
if(push_data_t()(listsize, shmlist, stdlist)){
if(push_data_t::execute(listsize, shmlist, stdlist)){
return 1;
}
if(push_data_t()(listsize, &othershmlist, &otherstdlist)){
if(push_data_t::execute(listsize, &othershmlist, &otherstdlist)){
return 1;
}

View File

@@ -40,9 +40,6 @@ int main ()
if(test::list_test<managed_shared_memory, MyMoveList, false>())
return 1;
if(test::list_test<managed_shared_memory, MyCopyMoveList, false>())
return 1;
return 0;
}

View File

@@ -10,6 +10,7 @@
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/containers/vector.hpp>
#include <boost/interprocess/containers/string.hpp>
#include <boost/interprocess/offset_ptr.hpp>