Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:53

0001 //////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga 2014-2014. Distributed under the Boost
0004 // Software License, Version 1.0. (See accompanying file
0005 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // See http://www.boost.org/libs/interprocess for documentation.
0008 //
0009 //////////////////////////////////////////////////////////////////////////////
0010 
0011 #ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP
0012 #define BOOST_MOVE_DETAIL_WORKAROUND_HPP
0013 
0014 #ifndef BOOST_CONFIG_HPP
0015 #  include <boost/config.hpp>
0016 #endif
0017 #
0018 #if defined(BOOST_HAS_PRAGMA_ONCE)
0019 #  pragma once
0020 #endif
0021 
0022 #if    !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0023    #define BOOST_MOVE_PERFECT_FORWARDING
0024 #endif
0025 
0026 #if defined(__has_feature)
0027    #define BOOST_MOVE_HAS_FEATURE __has_feature
0028 #else
0029    #define BOOST_MOVE_HAS_FEATURE(x) 0
0030 #endif
0031 
0032 #if BOOST_MOVE_HAS_FEATURE(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
0033    #define BOOST_MOVE_ADDRESS_SANITIZER_ON
0034 #endif
0035 
0036 //Macros for documentation purposes. For code, expands to the argument
0037 #define BOOST_MOVE_IMPDEF(TYPE) TYPE
0038 #define BOOST_MOVE_SEEDOC(TYPE) TYPE
0039 #define BOOST_MOVE_DOC0PTR(TYPE) TYPE
0040 #define BOOST_MOVE_DOC1ST(TYPE1, TYPE2) TYPE2
0041 #define BOOST_MOVE_I ,
0042 #define BOOST_MOVE_DOCIGN(T1) T1
0043 
0044 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__)
0045    //Pre-standard rvalue binding rules
0046    #define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
0047 #elif defined(_MSC_VER) && (_MSC_VER == 1600)
0048    //Standard rvalue binding rules but with some bugs
0049    #define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
0050    #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
0051 #elif defined(_MSC_VER) && (_MSC_VER == 1700)
0052    #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
0053 #endif
0054 
0055 //#define BOOST_MOVE_DISABLE_FORCEINLINE
0056 
0057 #if defined(BOOST_MOVE_DISABLE_FORCEINLINE)
0058    #define BOOST_MOVE_FORCEINLINE inline
0059 #elif defined(BOOST_MOVE_FORCEINLINE_IS_BOOST_FORCELINE)
0060    #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE
0061 #elif defined(BOOST_MSVC) && (_MSC_VER < 1900 || defined(_DEBUG))
0062    //"__forceinline" and MSVC seems to have some bugs in old versions and in debug mode
0063    #define BOOST_MOVE_FORCEINLINE inline
0064 #elif defined(BOOST_GCC) && (__GNUC__ <= 5)
0065    //Older GCCs have problems with forceinline
0066    #define BOOST_MOVE_FORCEINLINE inline
0067 #else
0068    #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE
0069 #endif
0070 
0071 namespace boost {
0072 namespace movelib {
0073 
0074 template <typename T1>
0075 BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore(T1 const&)
0076 {}
0077 
0078 }} //namespace boost::movelib {
0079 
0080 #if !(defined BOOST_NO_EXCEPTIONS)
0081 #    define BOOST_MOVE_TRY { try
0082 #    define BOOST_MOVE_CATCH(x) catch(x)
0083 #    define BOOST_MOVE_RETHROW throw;
0084 #    define BOOST_MOVE_CATCH_END }
0085 #else
0086 #    if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
0087 #        define BOOST_MOVE_TRY { if (true)
0088 #        define BOOST_MOVE_CATCH(x) else if (false)
0089 #    else
0090 // warning C4127: conditional expression is constant
0091 #        define BOOST_MOVE_TRY { \
0092              __pragma(warning(push)) \
0093              __pragma(warning(disable: 4127)) \
0094              if (true) \
0095              __pragma(warning(pop))
0096 #        define BOOST_MOVE_CATCH(x) else \
0097              __pragma(warning(push)) \
0098              __pragma(warning(disable: 4127)) \
0099              if (false) \
0100              __pragma(warning(pop))
0101 #    endif
0102 #    define BOOST_MOVE_RETHROW
0103 #    define BOOST_MOVE_CATCH_END }
0104 #endif
0105 
0106 #ifndef BOOST_NO_CXX11_STATIC_ASSERT
0107 #  ifndef BOOST_NO_CXX11_VARIADIC_MACROS
0108 #     define BOOST_MOVE_STATIC_ASSERT( ... ) static_assert(__VA_ARGS__, #__VA_ARGS__)
0109 #  else
0110 #     define BOOST_MOVE_STATIC_ASSERT( B ) static_assert(B, #B)
0111 #  endif
0112 #else
0113 namespace boost {
0114 namespace move_detail {
0115 
0116 template<bool B>
0117 struct STATIC_ASSERTION_FAILURE;
0118 
0119 template<>
0120 struct STATIC_ASSERTION_FAILURE<true>{};
0121 
0122 template<unsigned> struct static_assert_test {};
0123 
0124 }}
0125 
0126 #define BOOST_MOVE_STATIC_ASSERT(B) \
0127          typedef ::boost::move_detail::static_assert_test<\
0128             (unsigned)sizeof(::boost::move_detail::STATIC_ASSERTION_FAILURE<bool(B)>)>\
0129                BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
0130 
0131 #endif
0132 
0133 #if !defined(__has_cpp_attribute) || defined(__CUDACC__)
0134 #define BOOST_MOVE_HAS_MSVC_ATTRIBUTE(ATTR) 0
0135 #else
0136 #define BOOST_MOVE_HAS_MSVC_ATTRIBUTE(ATTR) __has_cpp_attribute(msvc::ATTR)
0137 #endif
0138 
0139 // See https://devblogs.microsoft.com/cppblog/improving-the-state-of-debug-performance-in-c/
0140 // for details on how MSVC has improved debug experience, specifically for move/forward-like utilities
0141 #if BOOST_MOVE_HAS_MSVC_ATTRIBUTE(intrinsic)
0142 #define BOOST_MOVE_INTRINSIC_CAST [[msvc::intrinsic]]
0143 #else
0144 #define BOOST_MOVE_INTRINSIC_CAST BOOST_MOVE_FORCEINLINE
0145 #endif
0146 
0147 #endif   //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP
0148