diff --git a/include/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp b/include/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp index 2e15f79..cf2d897 100644 --- a/include/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +++ b/include/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp @@ -17,8 +17,11 @@ // Defines the BOOST_SP_HAS_GCC_INTRINSICS macro if the __atomic_* // intrinsics are available. +// Libraries (e.g. Kokkos) sometimes define the __ATOMIC_RELAXED macros, +// leading to errors under MSVC (https://github.com/boostorg/smart_ptr/pull/112) -#if defined( __ATOMIC_RELAXED ) && defined( __ATOMIC_ACQUIRE ) && defined( __ATOMIC_RELEASE ) && defined( __ATOMIC_ACQ_REL ) +#if defined( __ATOMIC_RELAXED ) && defined( __ATOMIC_ACQUIRE ) && defined( __ATOMIC_RELEASE ) && defined( __ATOMIC_ACQ_REL ) \ + && !( defined(_MSC_VER) && !defined(__clang__) ) # define BOOST_SP_HAS_GCC_INTRINSICS