Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / beast / core / detail / config.hpp
1 //
2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
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)
6 //
7 // Official repository: https://github.com/boostorg/beast
8 //
9
10 #ifndef BOOST_BEAST_CORE_DETAIL_CONFIG_HPP
11 #define BOOST_BEAST_CORE_DETAIL_CONFIG_HPP
12
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>
18
19 namespace boost {
20 namespace asio
21 {
22 } // asio
23 namespace beast {
24 namespace net = boost::asio;
25 } // beast
26 } // boost
27
28 /*
29     _MSC_VER and _MSC_FULL_VER by version:
30
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
35 */
36
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
40 # endif
41
42 #elif defined(BOOST_GCC)
43 # if(BOOST_GCC < 40801)
44 #  error Beast requires C++11: gcc version 4.8 or later needed
45 # endif
46
47 #else
48 # if \
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
54 # endif
55
56 #endif
57
58 #define BOOST_BEAST_DEPRECATION_STRING \
59     "This is a deprecated interface, #define BOOST_BEAST_ALLOW_DEPRECATED to allow it"
60
61 #ifndef BOOST_BEAST_ASSUME
62 # ifdef BOOST_GCC
63 #  define BOOST_BEAST_ASSUME(cond) \
64     do { if (!(cond)) __builtin_unreachable(); } while (0)
65 # else
66 #  define BOOST_BEAST_ASSUME(cond) do { } while(0)
67 # endif
68 #endif
69
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
75 # endif
76 #endif
77
78 #if BOOST_BEAST_DOXYGEN
79 # define BOOST_BEAST_DECL
80 #elif defined(BOOST_BEAST_HEADER_ONLY)
81 # define BOOST_BEAST_DECL inline
82 #else
83 # define BOOST_BEAST_DECL
84 #endif
85
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))
89 #endif
90
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))
94 #endif
95
96 #ifndef BOOST_BEAST_ASYNC_TPARAM1
97 #define BOOST_BEAST_ASYNC_TPARAM1 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code))
98 #endif
99
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))
102 #endif
103
104 #endif