2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * Copyright (c) 2020 Andrey Semashev
9 * \file atomic/detail/type_traits/alignment_of.hpp
11 * This header defines \c alignment_of type trait
14 #ifndef BOOST_ATOMIC_DETAIL_TYPE_TRAITS_ALIGNMENT_OF_HPP_INCLUDED_
15 #define BOOST_ATOMIC_DETAIL_TYPE_TRAITS_ALIGNMENT_OF_HPP_INCLUDED_
17 #include <boost/atomic/detail/config.hpp>
19 #if defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS) ||\
20 (defined(BOOST_GCC) && BOOST_GCC < 80100) ||\
21 (defined(BOOST_CLANG) && !defined(__apple_build_version__) && __clang_major__ < 9) ||\
22 (defined(BOOST_CLANG) && defined(__apple_build_version__) && __clang_major__ < 10)
23 // For some compilers std::alignment_of gives the wrong result for 64-bit types on 32-bit targets
24 #define BOOST_ATOMIC_DETAIL_NO_CXX11_STD_ALIGNMENT_OF
27 #if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_STD_ALIGNMENT_OF)
28 #include <type_traits>
30 #include <boost/type_traits/alignment_of.hpp>
33 #ifdef BOOST_HAS_PRAGMA_ONCE
41 #if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_STD_ALIGNMENT_OF)
42 using std::alignment_of;
44 using boost::alignment_of;
48 } // namespace atomics
51 #endif // BOOST_ATOMIC_DETAIL_TYPE_TRAITS_ALIGNMENT_OF_HPP_INCLUDED_