File indexing completed on 2024-11-15 09:33:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_URL_DETAIL_CONFIG_HPP
0012 #define BOOST_URL_DETAIL_CONFIG_HPP
0013
0014 #include <boost/config.hpp>
0015 #include <boost/config/workaround.hpp>
0016 #include <limits.h>
0017 #include <stdint.h>
0018
0019 #if CHAR_BIT != 8
0020 # error unsupported platform
0021 #endif
0022
0023
0024 #if (defined(BOOST_URL_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_URL_STATIC_LINK)
0025 # define BOOST_URL_BUILD_DLL
0026 #endif
0027
0028
0029 #if !defined(BOOST_URL_BUILD_DLL)
0030 # define BOOST_URL_DECL
0031 #elif defined(BOOST_URL_SOURCE)
0032 # define BOOST_URL_DECL BOOST_SYMBOL_EXPORT
0033 #else
0034 # define BOOST_URL_DECL BOOST_SYMBOL_IMPORT
0035 #endif
0036
0037
0038 # if !defined(BOOST_URL_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_URL_NO_LIB)
0039 # define BOOST_LIB_NAME boost_url
0040 # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_URL_DYN_LINK)
0041 # define BOOST_DYN_LINK
0042 # endif
0043 # include <boost/config/auto_link.hpp>
0044 # endif
0045
0046
0047 #if ! defined(BOOST_URL_NO_SSE2) && \
0048 ! defined(BOOST_URL_USE_SSE2)
0049 # if (defined(_M_IX86) && _M_IX86_FP == 2) || \
0050 defined(_M_X64) || defined(__SSE2__)
0051 # define BOOST_URL_USE_SSE2
0052 # endif
0053 #endif
0054
0055
0056 #if BOOST_WORKAROUND( BOOST_GCC_VERSION, <= 72000 ) || \
0057 BOOST_WORKAROUND( BOOST_CLANG_VERSION, <= 35000 )
0058 # define BOOST_URL_CONSTEXPR
0059 #else
0060 # define BOOST_URL_CONSTEXPR constexpr
0061 #endif
0062
0063
0064 #ifdef BOOST_URL_NO_SOURCE_LOCATION
0065 # define BOOST_URL_ERR(ev) (::boost::system::error_code(ev))
0066 # define BOOST_URL_RETURN_EC(ev) return (ev)
0067 # define BOOST_URL_POS ::boost::source_location()
0068 #else
0069 # define BOOST_URL_ERR(ev) (::boost::system::error_code( (ev), [] { \
0070 static constexpr auto loc((BOOST_CURRENT_LOCATION)); \
0071 return &loc; }()))
0072 # define BOOST_URL_RETURN_EC(ev) \
0073 static constexpr auto loc ## __LINE__((BOOST_CURRENT_LOCATION)); \
0074 return ::boost::system::error_code((ev), &loc ## __LINE__)
0075 # define BOOST_URL_POS (BOOST_CURRENT_LOCATION)
0076 #endif
0077
0078
0079 #ifndef BOOST_URL_STRTOK_TPARAM
0080 #define BOOST_URL_STRTOK_TPARAM class StringToken = string_token::return_string
0081 #endif
0082 #ifndef BOOST_URL_STRTOK_RETURN
0083 #define BOOST_URL_STRTOK_RETURN typename StringToken::result_type
0084 #endif
0085 #ifndef BOOST_URL_STRTOK_ARG
0086 #define BOOST_URL_STRTOK_ARG(name) StringToken&& token = {}
0087 #endif
0088
0089
0090 #if BOOST_WORKAROUND( BOOST_GCC_VERSION, < 80000 ) || \
0091 BOOST_WORKAROUND( BOOST_CLANG_VERSION, < 30900 )
0092 #define BOOST_URL_RETURN(x) return std::move((x))
0093 #else
0094 #define BOOST_URL_RETURN(x) return (x)
0095 #endif
0096
0097
0098 #ifndef BOOST_URL_MAX_SIZE
0099
0100
0101 #define BOOST_URL_MAX_SIZE ((std::size_t(-1))-1)
0102 #endif
0103
0104
0105 #ifdef BOOST_GCC
0106 #define BOOST_URL_NO_INLINE [[gnu::noinline]]
0107 #else
0108 #define BOOST_URL_NO_INLINE
0109 #endif
0110
0111
0112 #ifndef BOOST_URL_COW_STRINGS
0113 #if defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 60000 || (defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0))
0114 #define BOOST_URL_COW_STRINGS
0115 #endif
0116 #endif
0117
0118
0119 #if UINTPTR_MAX == UINT64_MAX
0120 # define BOOST_URL_ARCH 64
0121 #elif UINTPTR_MAX == UINT32_MAX
0122 # define BOOST_URL_ARCH 32
0123 #else
0124 # error Unknown or unsupported architecture, please open an issue
0125 #endif
0126
0127
0128 #if defined(BOOST_MSVC) || defined(BOOST_URL_DOCS)
0129 #define BOOST_URL_DEPRECATED(msg)
0130 #else
0131 #define BOOST_URL_DEPRECATED(msg) BOOST_DEPRECATED(msg)
0132 #endif
0133
0134
0135 namespace boost {
0136 namespace urls {
0137
0138 template<class...> struct make_void { typedef void type; };
0139 template<class... Ts> using void_t = typename make_void<Ts...>::type;
0140
0141 }
0142 }
0143
0144 #endif