sp_has_gcc_intrinsics.hpp 995 B

123456789101112131415161718192021222324252627282930
  1. #ifndef BOOST_SMART_PTR_DETAIL_SP_HAS_GCC_INTRINSICS_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_DETAIL_SP_HAS_GCC_INTRINSICS_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. // boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp
  8. //
  9. // Copyright 2020 Peter Dimov
  10. // Distributed under the Boost Software License, Version 1.0.
  11. // https://www.boost.org/LICENSE_1_0.txt
  12. //
  13. // Defines the BOOST_SP_HAS_GCC_INTRINSICS macro if the __atomic_*
  14. // intrinsics are available.
  15. // Libraries (e.g. Kokkos) sometimes define the __ATOMIC_RELAXED macros,
  16. // leading to errors under MSVC (https://github.com/boostorg/smart_ptr/pull/112)
  17. #if defined( __ATOMIC_RELAXED ) && defined( __ATOMIC_ACQUIRE ) && defined( __ATOMIC_RELEASE ) && defined( __ATOMIC_ACQ_REL ) \
  18. && !( defined(_MSC_VER) && !defined(__clang__) )
  19. # define BOOST_SP_HAS_GCC_INTRINSICS
  20. #endif
  21. #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_HAS_GCC_INTRINSICS_HPP_INCLUDED