File indexing completed on 2025-12-15 09:45:36
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_CONTEXT_DETAIL_CONFIG_H
0008 #define BOOST_CONTEXT_DETAIL_CONFIG_H
0009
0010
0011 #include <utility>
0012
0013 #include <boost/config.hpp>
0014 #include <boost/detail/workaround.hpp>
0015
0016 #ifdef BOOST_CONTEXT_DECL
0017 # undef BOOST_CONTEXT_DECL
0018 #endif
0019
0020 #if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK) ) && ! defined(BOOST_CONTEXT_STATIC_LINK)
0021 # if defined(BOOST_CONTEXT_SOURCE)
0022 # define BOOST_CONTEXT_DECL BOOST_SYMBOL_EXPORT
0023 # define BOOST_CONTEXT_BUILD_DLL
0024 # else
0025 # define BOOST_CONTEXT_DECL BOOST_SYMBOL_IMPORT
0026 # endif
0027 #endif
0028
0029 #if ! defined(BOOST_CONTEXT_DECL)
0030 # define BOOST_CONTEXT_DECL
0031 #endif
0032
0033 #if ! defined(BOOST_USE_UCONTEXT) && defined(__CYGWIN__)
0034 # define BOOST_USE_UCONTEXT
0035 #endif
0036
0037 #if ! defined(BOOST_CONTEXT_SOURCE) && ! defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_CONTEXT_NO_LIB)
0038 # define BOOST_LIB_NAME boost_context
0039 # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK)
0040 # define BOOST_DYN_LINK
0041 # endif
0042 # include <boost/config/auto_link.hpp>
0043 #endif
0044
0045 #undef BOOST_CONTEXT_CALLDECL
0046 #if (defined(i386) || defined(__i386__) || defined(__i386) \
0047 || defined(__i486__) || defined(__i586__) || defined(__i686__) \
0048 || defined(__X86__) || defined(_X86_) || defined(__THW_INTEL__) \
0049 || defined(__I86__) || defined(__INTEL__) || defined(__IA32__) \
0050 || defined(_M_IX86) || defined(_I86_)) && defined(BOOST_WINDOWS)
0051 # define BOOST_CONTEXT_CALLDECL __cdecl
0052 #else
0053 # define BOOST_CONTEXT_CALLDECL
0054 #endif
0055
0056 #if defined(BOOST_USE_SEGMENTED_STACKS)
0057 # if ! ( (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) ) ) || \
0058 (defined(__clang__) && (__clang_major__ > 2 || ( __clang_major__ == 2 && __clang_minor__ > 3) ) ) )
0059 # error "compiler does not support segmented_stack stacks"
0060 # endif
0061 # define BOOST_CONTEXT_SEGMENTS 10
0062 #endif
0063
0064
0065 #define BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE
0066
0067 #if defined(__cpp_lib_integer_sequence) && __cpp_lib_integer_sequence >= 201304
0068 # undef BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE
0069 #endif
0070
0071 #if _MSC_VER > 1800
0072 # undef BOOST_CONTEXT_NO_INDEX_SEQUENCE
0073 #endif
0074
0075 #if ! defined(__cpp_lib_integer_sequence) && __cpp_lib_integer_sequence >= 201304
0076 # if _LIBCPP_STD_VER > 11
0077 # undef BOOST_CONTEXT_NO_CXX14_INTEGER_SEQUENCE
0078 # endif
0079 #endif
0080
0081
0082 #if _MSC_VER > 1800
0083 # undef BOOST_NO_CXX11_CONSTEXPR
0084 #endif
0085
0086 #undef BOOST_CONTEXT_NO_CXX11
0087 #if defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || \
0088 defined(BOOST_NO_CXX11_CONSTEXPR) || \
0089 defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || \
0090 defined(BOOST_NO_CXX11_FINAL) || \
0091 defined(BOOST_NO_CXX11_HDR_TUPLE) || \
0092 defined(BOOST_NO_CXX11_NOEXCEPT) || \
0093 defined(BOOST_NO_CXX11_NULLPTR) || \
0094 defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
0095 defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) || \
0096 defined(BOOST_NO_CXX11_UNIFIED_INITIALISATION_SYNTAX) || \
0097 defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
0098 defined(BOOST_NO_HDR_ATOMIC) || \
0099 defined(BOOST_NO_HDR_TUPLE)
0100 # define BOOST_CONTEXT_NO_CXX11
0101 #endif
0102
0103 #if ! defined(BOOST_EXECUTION_CONTEXT)
0104 # if defined(BOOST_USE_SEGMENTED_STACKS)
0105 # define BOOST_EXECUTION_CONTEXT 1
0106 # else
0107 # define BOOST_EXECUTION_CONTEXT 2
0108 # endif
0109 #endif
0110
0111 #if ! defined(BOOST_NO_CXX11_CONSTEXPR)
0112
0113
0114
0115
0116 static constexpr std::size_t cache_alignment{ 64 };
0117 static constexpr std::size_t cacheline_length{ 64 };
0118
0119 static constexpr std::size_t prefetch_stride{ 4 * cacheline_length };
0120 #endif
0121
0122 #if defined(__GLIBCPP__) || defined(__GLIBCXX__)
0123
0124 # define BOOST_CONTEXT_HAS_CXXABI_H
0125 #endif
0126
0127 #if defined( BOOST_CONTEXT_HAS_CXXABI_H )
0128 # include <cxxabi.h>
0129 #endif
0130
0131 #if defined(__OpenBSD__)
0132
0133 # define BOOST_CONTEXT_USE_MAP_STACK
0134 #endif
0135
0136 #endif