diff --git a/include/boost/memory_order.hpp b/include/boost/memory_order.hpp deleted file mode 100644 index 4945af6..0000000 --- a/include/boost/memory_order.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef BOOST_MEMORY_ORDER_HPP_INCLUDED -#define BOOST_MEMORY_ORDER_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// boost/memory_order.hpp -// -// Defines enum boost::memory_order per the C++0x working draft -// -// Copyright (c) 2008, 2009 Peter Dimov -// -// 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) - - -namespace boost -{ - -// -// Enum values are chosen so that code that needs to insert -// a trailing fence for acquire semantics can use a single -// test such as: -// -// if( mo & memory_order_acquire ) { ...fence... } -// -// For leading fences one can use: -// -// if( mo & memory_order_release ) { ...fence... } -// -// Architectures such as Alpha that need a fence on consume -// can use: -// -// if( mo & ( memory_order_acquire | memory_order_consume ) ) { ...fence... } -// - -enum memory_order -{ - memory_order_relaxed = 0, - memory_order_acquire = 1, - memory_order_release = 2, - memory_order_acq_rel = 3, // acquire | release - memory_order_seq_cst = 7, // acq_rel | 4 - memory_order_consume = 8 -}; - -} // namespace boost - -#endif // #ifndef BOOST_MEMORY_ORDER_HPP_INCLUDED diff --git a/include/boost/smart_ptr/shared_ptr.hpp b/include/boost/smart_ptr/shared_ptr.hpp index 3aeb489..83b0451 100644 --- a/include/boost/smart_ptr/shared_ptr.hpp +++ b/include/boost/smart_ptr/shared_ptr.hpp @@ -32,7 +32,6 @@ #if !defined(BOOST_SP_NO_ATOMIC_ACCESS) #include -#include #endif #include // for std::swap @@ -951,7 +950,7 @@ template shared_ptr atomic_load( shared_ptr const * p ) return *p; } -template inline shared_ptr atomic_load_explicit( shared_ptr const * p, memory_order /*mo*/ ) +template inline shared_ptr atomic_load_explicit( shared_ptr const * p, /*memory_order mo*/ int ) { return atomic_load( p ); } @@ -962,7 +961,7 @@ template void atomic_store( shared_ptr * p, shared_ptr r ) p->swap( r ); } -template inline void atomic_store_explicit( shared_ptr * p, shared_ptr r, memory_order /*mo*/ ) +template inline void atomic_store_explicit( shared_ptr * p, shared_ptr r, /*memory_order mo*/ int ) { atomic_store( p, r ); // std::move( r ) } @@ -978,7 +977,7 @@ template shared_ptr atomic_exchange( shared_ptr * p, shared_ptr shared_ptr atomic_exchange_explicit( shared_ptr * p, shared_ptr r, memory_order /*mo*/ ) +template shared_ptr atomic_exchange_explicit( shared_ptr * p, shared_ptr r, /*memory_order mo*/ int ) { return atomic_exchange( p, r ); // std::move( r ) } @@ -1008,7 +1007,7 @@ template bool atomic_compare_exchange( shared_ptr * p, shared_ptr } } -template inline bool atomic_compare_exchange_explicit( shared_ptr * p, shared_ptr * v, shared_ptr w, memory_order /*success*/, memory_order /*failure*/ ) +template inline bool atomic_compare_exchange_explicit( shared_ptr * p, shared_ptr * v, shared_ptr w, /*memory_order success*/ int, /*memory_order failure*/ int ) { return atomic_compare_exchange( p, v, w ); // std::move( w ) } diff --git a/test/sp_atomic_test.cpp b/test/sp_atomic_test.cpp index c8c3586..3201c49 100644 --- a/test/sp_atomic_test.cpp +++ b/test/sp_atomic_test.cpp @@ -11,6 +11,7 @@ #include #include +#include //