Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:53:56

0001 //
0002 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
0003 // Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0006 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // Official repository: https://github.com/boostorg/url
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 // Determine if compiling as a dynamic library
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 // Set visibility flags
0029 #if !defined(BOOST_URL_BUILD_DLL)
0030 #    define BOOST_URL_DECL /* static library */
0031 #elif defined(BOOST_URL_SOURCE)
0032 #    define BOOST_URL_DECL BOOST_SYMBOL_EXPORT /* source: dllexport/visibility */
0033 #else
0034 #    define BOOST_URL_DECL BOOST_SYMBOL_IMPORT /* header: dllimport */
0035 #endif
0036 
0037 // Set up auto-linker
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 // Set up SSE2
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 // constexpr
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 // Add source location to error codes
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 #if !defined(BOOST_NO_CXX20_HDR_CONCEPTS) && defined(__cpp_lib_concepts)
0079 #define BOOST_URL_HAS_CONCEPTS
0080 #endif
0081 
0082 #ifdef  BOOST_URL_HAS_CONCEPTS
0083 #define BOOST_URL_CONSTRAINT(C) C
0084 #else
0085 #define BOOST_URL_CONSTRAINT(C) class
0086 #endif
0087 
0088 // String token parameters
0089 #ifndef BOOST_URL_STRTOK_TPARAM
0090 #define BOOST_URL_STRTOK_TPARAM BOOST_URL_CONSTRAINT(string_token::StringToken) StringToken = string_token::return_string
0091 #endif
0092 #ifndef BOOST_URL_STRTOK_RETURN
0093 #define BOOST_URL_STRTOK_RETURN typename StringToken::result_type
0094 #endif
0095 #ifndef BOOST_URL_STRTOK_ARG
0096 #define BOOST_URL_STRTOK_ARG(name) StringToken&& token = {}
0097 #endif
0098 
0099 // Move
0100 #if BOOST_WORKAROUND( BOOST_GCC_VERSION, < 80000 ) || \
0101     BOOST_WORKAROUND( BOOST_CLANG_VERSION, < 30900 )
0102 #define BOOST_URL_RETURN(x) return std::move((x))
0103 #else
0104 #define BOOST_URL_RETURN(x) return (x)
0105 #endif
0106 
0107 // Limit tests
0108 #ifndef BOOST_URL_MAX_SIZE
0109 // we leave room for a null,
0110 // and still fit in size_t
0111 #define BOOST_URL_MAX_SIZE ((std::size_t(-1))-1)
0112 #endif
0113 
0114 // noinline attribute
0115 #ifdef BOOST_GCC
0116 #define BOOST_URL_NO_INLINE [[gnu::noinline]]
0117 #else
0118 #define BOOST_URL_NO_INLINE
0119 #endif
0120 
0121 // libstdcxx copy-on-write strings
0122 #ifndef BOOST_URL_COW_STRINGS
0123 #if defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 60000 || (defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0))
0124 #define BOOST_URL_COW_STRINGS
0125 #endif
0126 #endif
0127 
0128 // detect 32/64 bit
0129 #if UINTPTR_MAX == UINT64_MAX
0130 # define BOOST_URL_ARCH 64
0131 #elif UINTPTR_MAX == UINT32_MAX
0132 # define BOOST_URL_ARCH 32
0133 #else
0134 # error Unknown or unsupported architecture, please open an issue
0135 #endif
0136 
0137 // deprecated attribute
0138 #if defined(BOOST_MSVC) || defined(BOOST_URL_DOCS)
0139 #define BOOST_URL_DEPRECATED(msg)
0140 #else
0141 #define BOOST_URL_DEPRECATED(msg) BOOST_DEPRECATED(msg)
0142 #endif
0143 
0144 // Implementation defined type for Doxygen while Clang
0145 // can still parse the comments into the AST
0146 #ifndef BOOST_URL_DOCS
0147 #define BOOST_URL_IMPLEMENTATION_DEFINED(Type) Type
0148 #else
0149 #define BOOST_URL_IMPLEMENTATION_DEFINED(Type) __implementation_defined__
0150 #endif
0151 
0152 #ifndef BOOST_URL_DOCS
0153 #define BOOST_URL_SEE_BELOW(Type) Type
0154 #else
0155 #define BOOST_URL_SEE_BELOW(Type) __see_below__
0156 #endif
0157 
0158 #ifdef __cpp_lib_array_constexpr
0159 #define BOOST_URL_LIB_ARRAY_CONSTEXPR constexpr
0160 #else
0161 #define BOOST_URL_LIB_ARRAY_CONSTEXPR
0162 #endif
0163 
0164 // avoid Boost.TypeTraits for these traits
0165 namespace boost {
0166 namespace urls {
0167 
0168 template<class...> struct make_void { typedef void type; };
0169 template<class... Ts> using void_t = typename make_void<Ts...>::type;
0170 
0171 } // urls
0172 } // boost
0173 
0174 #endif