]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/atomic/detail/type_traits/alignment_of.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / atomic / detail / type_traits / alignment_of.hpp
1 /*
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)
5 *
6 * Copyright (c) 2020 Andrey Semashev
7 */
8 /*!
9 * \file atomic/detail/type_traits/alignment_of.hpp
10 *
11 * This header defines \c alignment_of type trait
12 */
13
14 #ifndef BOOST_ATOMIC_DETAIL_TYPE_TRAITS_ALIGNMENT_OF_HPP_INCLUDED_
15 #define BOOST_ATOMIC_DETAIL_TYPE_TRAITS_ALIGNMENT_OF_HPP_INCLUDED_
16
17 #include <boost/atomic/detail/config.hpp>
18
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
25 #endif
26
27 #if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_STD_ALIGNMENT_OF)
28 #include <type_traits>
29 #else
30 #include <boost/type_traits/alignment_of.hpp>
31 #endif
32
33 #ifdef BOOST_HAS_PRAGMA_ONCE
34 #pragma once
35 #endif
36
37 namespace boost {
38 namespace atomics {
39 namespace detail {
40
41 #if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_STD_ALIGNMENT_OF)
42 using std::alignment_of;
43 #else
44 using boost::alignment_of;
45 #endif
46
47 } // namespace detail
48 } // namespace atomics
49 } // namespace boost
50
51 #endif // BOOST_ATOMIC_DETAIL_TYPE_TRAITS_ALIGNMENT_OF_HPP_INCLUDED_