summaryrefslogtreecommitdiff
path: root/boost/atomic/detail/ops_gcc_ppc_common.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/atomic/detail/ops_gcc_ppc_common.hpp')
-rw-r--r--boost/atomic/detail/ops_gcc_ppc_common.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/boost/atomic/detail/ops_gcc_ppc_common.hpp b/boost/atomic/detail/ops_gcc_ppc_common.hpp
index 3aa4e5f15f..e5c9303bf7 100644
--- a/boost/atomic/detail/ops_gcc_ppc_common.hpp
+++ b/boost/atomic/detail/ops_gcc_ppc_common.hpp
@@ -40,6 +40,7 @@ namespace detail {
struct gcc_ppc_operations_base
{
+ static BOOST_CONSTEXPR_OR_CONST bool full_cas_based = false;
static BOOST_CONSTEXPR_OR_CONST bool is_always_lock_free = true;
static BOOST_FORCEINLINE void fence_before(memory_order order) BOOST_NOEXCEPT
@@ -47,17 +48,17 @@ struct gcc_ppc_operations_base
#if defined(__powerpc64__) || defined(__PPC64__)
if (order == memory_order_seq_cst)
__asm__ __volatile__ ("sync" ::: "memory");
- else if ((order & memory_order_release) != 0)
+ else if ((static_cast< unsigned int >(order) & static_cast< unsigned int >(memory_order_release)) != 0u)
__asm__ __volatile__ ("lwsync" ::: "memory");
#else
- if ((order & memory_order_release) != 0)
+ if ((static_cast< unsigned int >(order) & static_cast< unsigned int >(memory_order_release)) != 0u)
__asm__ __volatile__ ("sync" ::: "memory");
#endif
}
static BOOST_FORCEINLINE void fence_after(memory_order order) BOOST_NOEXCEPT
{
- if ((order & (memory_order_consume | memory_order_acquire)) != 0)
+ if ((static_cast< unsigned int >(order) & (static_cast< unsigned int >(memory_order_consume) | static_cast< unsigned int >(memory_order_acquire))) != 0u)
__asm__ __volatile__ ("isync" ::: "memory");
}
};