Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:28

0001 #ifndef BOOST_CORE_ALIGNOF_HPP_INCLUDED
0002 #define BOOST_CORE_ALIGNOF_HPP_INCLUDED
0003 
0004 // MS compatible compilers support #pragma once
0005 
0006 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
0007 # pragma once
0008 #endif
0009 
0010 //  Copyright 2023 Peter Dimov
0011 //  Distributed under the Boost Software License, Version 1.0.
0012 //  https://www.boost.org/LICENSE_1_0.txt
0013 
0014 #include <boost/config.hpp>
0015 #include <cstddef>
0016 
0017 #if !defined(BOOST_NO_CXX11_ALIGNOF)
0018 
0019 #define BOOST_CORE_ALIGNOF alignof
0020 
0021 #elif defined(__GNUC__)
0022 
0023 #define BOOST_CORE_ALIGNOF __alignof__
0024 
0025 #elif defined(_MSC_VER)
0026 
0027 #define BOOST_CORE_ALIGNOF __alignof
0028 
0029 #else
0030 
0031 namespace boost
0032 {
0033 namespace core
0034 {
0035 namespace detail
0036 {
0037 
0038 template<class T> struct alignof_helper
0039 {
0040     char x;
0041     T t;
0042 };
0043 
0044 } // namespace detail
0045 } // namespace core
0046 } // namespace boost
0047 
0048 #if defined(__GNUC__)
0049 // ignoring -Wvariadic-macros with #pragma doesn't work under GCC
0050 # pragma GCC system_header
0051 #endif
0052 
0053 #define BOOST_CORE_ALIGNOF(...) offsetof( ::boost::core::detail::alignof_helper<__VA_ARGS__>, t );
0054 
0055 #endif
0056 
0057 #endif  // #ifndef BOOST_CORE_ALIGNOF_HPP_INCLUDED