2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_CORE_DETAIL_CONFIG_HPP
11 #define BOOST_BEAST_CORE_DETAIL_CONFIG_HPP
13 // Available to every header
14 #include <boost/config.hpp>
15 #include <boost/version.hpp>
16 #include <boost/core/ignore_unused.hpp>
17 #include <boost/static_assert.hpp>
24 namespace net = boost::asio;
29 _MSC_VER and _MSC_FULL_VER by version:
31 14.0 (2015) 1900 190023026
32 14.0 (2015 Update 1) 1900 190023506
33 14.0 (2015 Update 2) 1900 190023918
34 14.0 (2015 Update 3) 1900 190024210
37 #if defined(BOOST_MSVC)
38 # if BOOST_MSVC_FULL_VER < 190024210
39 # error Beast requires C++11: Visual Studio 2015 Update 3 or later needed
42 #elif defined(BOOST_GCC)
43 # if(BOOST_GCC < 40801)
44 # error Beast requires C++11: gcc version 4.8 or later needed
49 defined(BOOST_NO_CXX11_DECLTYPE) || \
50 defined(BOOST_NO_CXX11_HDR_TUPLE) || \
51 defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) || \
52 defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
53 # error Beast requires C++11: a conforming compiler is needed
58 #define BOOST_BEAST_DEPRECATION_STRING \
59 "This is a deprecated interface, #define BOOST_BEAST_ALLOW_DEPRECATED to allow it"
61 #ifndef BOOST_BEAST_ASSUME
63 # define BOOST_BEAST_ASSUME(cond) \
64 do { if (!(cond)) __builtin_unreachable(); } while (0)
66 # define BOOST_BEAST_ASSUME(cond) do { } while(0)
70 // Default to a header-only implementation. The user must specifically
71 // request separate compilation by defining BOOST_BEAST_SEPARATE_COMPILATION
72 #ifndef BOOST_BEAST_HEADER_ONLY
73 # ifndef BOOST_BEAST_SEPARATE_COMPILATION
74 # define BOOST_BEAST_HEADER_ONLY 1
78 #if BOOST_BEAST_DOXYGEN
79 # define BOOST_BEAST_DECL
80 #elif defined(BOOST_BEAST_HEADER_ONLY)
81 # define BOOST_BEAST_DECL inline
83 # define BOOST_BEAST_DECL
86 #ifndef BOOST_BEAST_ASYNC_RESULT1
87 #define BOOST_BEAST_ASYNC_RESULT1(type) \
88 BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(type, void(::boost::beast::error_code))
91 #ifndef BOOST_BEAST_ASYNC_RESULT2
92 #define BOOST_BEAST_ASYNC_RESULT2(type) \
93 BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(type, void(::boost::beast::error_code, ::std::size_t))
96 #ifndef BOOST_BEAST_ASYNC_TPARAM1
97 #define BOOST_BEAST_ASYNC_TPARAM1 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code))
100 #ifndef BOOST_BEAST_ASYNC_TPARAM2
101 #define BOOST_BEAST_ASYNC_TPARAM2 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code, ::std::size_t))