Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:43:54

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/beast
0008 //
0009 
0010 #ifndef BOOST_BEAST_CORE_DETAIL_CONFIG_HPP
0011 #define BOOST_BEAST_CORE_DETAIL_CONFIG_HPP
0012 
0013 // Available to every header
0014 #include <boost/config.hpp>
0015 #include <boost/version.hpp>
0016 #include <boost/core/ignore_unused.hpp>
0017 #include <boost/static_assert.hpp>
0018 #include <boost/preprocessor/cat.hpp>
0019 
0020 namespace boost {
0021 namespace asio
0022 {
0023 } // asio
0024 namespace beast {
0025 namespace net = boost::asio;
0026 } // beast
0027 } // boost
0028 
0029 /*
0030     _MSC_VER and _MSC_FULL_VER by version:
0031 
0032     14.0 (2015)             1900        190023026
0033     14.0 (2015 Update 1)    1900        190023506
0034     14.0 (2015 Update 2)    1900        190023918
0035     14.0 (2015 Update 3)    1900        190024210
0036 */
0037 
0038 #if defined(BOOST_MSVC)
0039 # if BOOST_MSVC_FULL_VER < 190024210
0040 #  error Beast requires C++11: Visual Studio 2015 Update 3 or later needed
0041 # endif
0042 
0043 #elif defined(BOOST_GCC)
0044 # if(BOOST_GCC < 50000)
0045 #  error Beast requires C++11: gcc version 5 or later needed
0046 # endif
0047 
0048 #else
0049 # if \
0050     defined(BOOST_NO_CXX11_DECLTYPE) || \
0051     defined(BOOST_NO_CXX11_HDR_TUPLE) || \
0052     defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) || \
0053     defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0054 #  error Beast requires C++11: a conforming compiler is needed
0055 # endif
0056 
0057 #endif
0058 
0059 #define BOOST_BEAST_DEPRECATION_STRING \
0060     "This is a deprecated interface, #define BOOST_BEAST_ALLOW_DEPRECATED to allow it"
0061 
0062 #ifndef BOOST_BEAST_ASSUME
0063 # ifdef BOOST_GCC
0064 #  define BOOST_BEAST_ASSUME(cond) \
0065     do { if (!(cond)) __builtin_unreachable(); } while (0)
0066 # else
0067 #  define BOOST_BEAST_ASSUME(cond) do { } while(0)
0068 # endif
0069 #endif
0070 
0071 // Default to a header-only implementation. The user must specifically
0072 // request separate compilation by defining BOOST_BEAST_SEPARATE_COMPILATION
0073 #ifndef BOOST_BEAST_HEADER_ONLY
0074 # ifndef BOOST_BEAST_SEPARATE_COMPILATION
0075 #   define BOOST_BEAST_HEADER_ONLY 1
0076 # endif
0077 #endif
0078 
0079 #if BOOST_BEAST_DOXYGEN
0080 # define BOOST_BEAST_DECL
0081 #elif defined(BOOST_BEAST_HEADER_ONLY)
0082 # define BOOST_BEAST_DECL inline
0083 #else
0084 # define BOOST_BEAST_DECL
0085 #endif
0086 
0087 #ifndef BOOST_BEAST_ASYNC_RESULT1
0088 #define BOOST_BEAST_ASYNC_RESULT1(type) \
0089     BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(type, void(::boost::beast::error_code))
0090 #endif
0091 
0092 #ifndef BOOST_BEAST_ASYNC_RESULT2
0093 #define BOOST_BEAST_ASYNC_RESULT2(type) \
0094     BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(type, void(::boost::beast::error_code, ::std::size_t))
0095 #endif
0096 
0097 #ifndef BOOST_BEAST_ASYNC_TPARAM1
0098 #define BOOST_BEAST_ASYNC_TPARAM1 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code))
0099 #endif
0100 
0101 #ifndef BOOST_BEAST_ASYNC_TPARAM2
0102 #define BOOST_BEAST_ASYNC_TPARAM2 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code, ::std::size_t))
0103 #endif
0104 
0105 
0106 #ifdef BOOST_BEAST_NO_SOURCE_LOCATION
0107 #define BOOST_BEAST_ASSIGN_EC(ec, error) ec = error
0108 #else
0109 
0110 #define BOOST_BEAST_ASSIGN_EC(ec, error) \
0111     static constexpr auto BOOST_PP_CAT(loc_, __LINE__) ((BOOST_CURRENT_LOCATION)); \
0112     ec.assign(error, & BOOST_PP_CAT(loc_, __LINE__) )
0113 
0114 #endif
0115 
0116 #ifndef BOOST_BEAST_FILE_BUFFER_SIZE
0117 #define BOOST_BEAST_FILE_BUFFER_SIZE 4096
0118 #endif
0119 
0120 #endif