1 //
2 // detail/config.hpp
3 // ~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef BOOST_ASIO_DETAIL_CONFIG_HPP
12 #define BOOST_ASIO_DETAIL_CONFIG_HPP
13 
14 #if defined(BOOST_ASIO_STANDALONE)
15 # define BOOST_ASIO_DISABLE_BOOST_ARRAY 1
16 # define BOOST_ASIO_DISABLE_BOOST_ASSERT 1
17 # define BOOST_ASIO_DISABLE_BOOST_BIND 1
18 # define BOOST_ASIO_DISABLE_BOOST_CHRONO 1
19 # define BOOST_ASIO_DISABLE_BOOST_DATE_TIME 1
20 # define BOOST_ASIO_DISABLE_BOOST_LIMITS 1
21 # define BOOST_ASIO_DISABLE_BOOST_REGEX 1
22 # define BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT 1
23 # define BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION 1
24 # define BOOST_ASIO_DISABLE_BOOST_WORKAROUND 1
25 #else // defined(BOOST_ASIO_STANDALONE)
26 # include <boost/config.hpp>
27 # include <boost/version.hpp>
28 # define BOOST_ASIO_HAS_BOOST_CONFIG 1
29 #endif // defined(BOOST_ASIO_STANDALONE)
30 
31 // Default to a header-only implementation. The user must specifically request
32 // separate compilation by defining either BOOST_ASIO_SEPARATE_COMPILATION or
33 // BOOST_ASIO_DYN_LINK (as a DLL/shared library implies separate compilation).
34 #if !defined(BOOST_ASIO_HEADER_ONLY)
35 # if !defined(BOOST_ASIO_SEPARATE_COMPILATION)
36 #  if !defined(BOOST_ASIO_DYN_LINK)
37 #   define BOOST_ASIO_HEADER_ONLY 1
38 #  endif // !defined(BOOST_ASIO_DYN_LINK)
39 # endif // !defined(BOOST_ASIO_SEPARATE_COMPILATION)
40 #endif // !defined(BOOST_ASIO_HEADER_ONLY)
41 
42 #if defined(BOOST_ASIO_HEADER_ONLY)
43 # define BOOST_ASIO_DECL inline
44 #else // defined(BOOST_ASIO_HEADER_ONLY)
45 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
46 // We need to import/export our code only if the user has specifically asked
47 // for it by defining BOOST_ASIO_DYN_LINK.
48 #  if defined(BOOST_ASIO_DYN_LINK)
49 // Export if this is our own source, otherwise import.
50 #   if defined(BOOST_ASIO_SOURCE)
51 #    define BOOST_ASIO_DECL __declspec(dllexport)
52 #   else // defined(BOOST_ASIO_SOURCE)
53 #    define BOOST_ASIO_DECL __declspec(dllimport)
54 #   endif // defined(BOOST_ASIO_SOURCE)
55 #  endif // defined(BOOST_ASIO_DYN_LINK)
56 # endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
57 #endif // defined(BOOST_ASIO_HEADER_ONLY)
58 
59 // If BOOST_ASIO_DECL isn't defined yet define it now.
60 #if !defined(BOOST_ASIO_DECL)
61 # define BOOST_ASIO_DECL
62 #endif // !defined(BOOST_ASIO_DECL)
63 
64 // Helper macro for documentation.
65 #define BOOST_ASIO_UNSPECIFIED(e) e
66 
67 // Microsoft Visual C++ detection.
68 #if !defined(BOOST_ASIO_MSVC)
69 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
70 #  define BOOST_ASIO_MSVC BOOST_MSVC
71 # elif defined(_MSC_VER) && (defined(__INTELLISENSE__) \
72       || (!defined(__MWERKS__) && !defined(__EDG_VERSION__)))
73 #  define BOOST_ASIO_MSVC _MSC_VER
74 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
75 #endif // !defined(BOOST_ASIO_MSVC)
76 
77 // Clang / libc++ detection.
78 #if defined(__clang__)
79 # if (__cplusplus >= 201103)
80 #  if __has_include(<__config>)
81 #   include <__config>
82 #   if defined(_LIBCPP_VERSION)
83 #    define BOOST_ASIO_HAS_CLANG_LIBCXX 1
84 #   endif // defined(_LIBCPP_VERSION)
85 #  endif // __has_include(<__config>)
86 # endif // (__cplusplus >= 201103)
87 #endif // defined(__clang__)
88 
89 // Android platform detection.
90 #if defined(__ANDROID__)
91 # include <android/api-level.h>
92 #endif // defined(__ANDROID__)
93 
94 // Support move construction and assignment on compilers known to allow it.
95 #if !defined(BOOST_ASIO_HAS_MOVE)
96 # if !defined(BOOST_ASIO_DISABLE_MOVE)
97 #  if defined(__clang__)
98 #   if __has_feature(__cxx_rvalue_references__)
99 #    define BOOST_ASIO_HAS_MOVE 1
100 #   endif // __has_feature(__cxx_rvalue_references__)
101 #  endif // defined(__clang__)
102 #  if defined(__GNUC__)
103 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
104 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
105 #     define BOOST_ASIO_HAS_MOVE 1
106 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
107 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
108 #  endif // defined(__GNUC__)
109 #  if defined(BOOST_ASIO_MSVC)
110 #   if (_MSC_VER >= 1700)
111 #    define BOOST_ASIO_HAS_MOVE 1
112 #   endif // (_MSC_VER >= 1700)
113 #  endif // defined(BOOST_ASIO_MSVC)
114 #  if defined(__INTEL_CXX11_MODE__)
115 #    if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
116 #      define BOOST_ASIO_HAS_MOVE 1
117 #    endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
118 #    if defined(__ICL) && (__ICL >= 1500)
119 #      define BOOST_ASIO_HAS_MOVE 1
120 #    endif // defined(__ICL) && (__ICL >= 1500)
121 #  endif // defined(__INTEL_CXX11_MODE__)
122 # endif // !defined(BOOST_ASIO_DISABLE_MOVE)
123 #endif // !defined(BOOST_ASIO_HAS_MOVE)
124 
125 // If BOOST_ASIO_MOVE_CAST isn't defined, and move support is available, define
126 // * BOOST_ASIO_MOVE_ARG,
127 // * BOOST_ASIO_NONDEDUCED_MOVE_ARG, and
128 // * BOOST_ASIO_MOVE_CAST
129 // to take advantage of rvalue references and perfect forwarding.
130 #if defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
131 # define BOOST_ASIO_MOVE_ARG(type) type&&
132 # define BOOST_ASIO_MOVE_ARG2(type1, type2) type1, type2&&
133 # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) type&
134 # define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
135 # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
136 # define BOOST_ASIO_MOVE_OR_LVALUE(type) static_cast<type&&>
137 # define BOOST_ASIO_MOVE_OR_LVALUE_TYPE(type) type
138 #endif // defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
139 
140 // If BOOST_ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible
141 // implementation. Note that older g++ and MSVC versions don't like it when you
142 // pass a non-member function through a const reference, so for most compilers
143 // we'll play it safe and stick with the old approach of passing the handler by
144 // value.
145 #if !defined(BOOST_ASIO_MOVE_CAST)
146 # if defined(__GNUC__)
147 #  if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
148 #   define BOOST_ASIO_MOVE_ARG(type) const type&
149 #  else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
150 #   define BOOST_ASIO_MOVE_ARG(type) type
151 #  endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
152 # elif defined(BOOST_ASIO_MSVC)
153 #  if (_MSC_VER >= 1400)
154 #   define BOOST_ASIO_MOVE_ARG(type) const type&
155 #  else // (_MSC_VER >= 1400)
156 #   define BOOST_ASIO_MOVE_ARG(type) type
157 #  endif // (_MSC_VER >= 1400)
158 # else
159 #  define BOOST_ASIO_MOVE_ARG(type) type
160 # endif
161 # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) const type&
162 # define BOOST_ASIO_MOVE_CAST(type) static_cast<const type&>
163 # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
164 # define BOOST_ASIO_MOVE_OR_LVALUE(type)
165 # define BOOST_ASIO_MOVE_OR_LVALUE_TYPE(type) type&
166 #endif // !defined(BOOST_ASIO_MOVE_CAST)
167 
168 // Support variadic templates on compilers known to allow it.
169 #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
170 # if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
171 #  if defined(__clang__)
172 #   if __has_feature(__cxx_variadic_templates__)
173 #    define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
174 #   endif // __has_feature(__cxx_variadic_templates__)
175 #  endif // defined(__clang__)
176 #  if defined(__GNUC__)
177 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
178 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
179 #     define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
180 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
181 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
182 #  endif // defined(__GNUC__)
183 #  if defined(BOOST_ASIO_MSVC)
184 #   if (_MSC_VER >= 1900)
185 #    define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
186 #   endif // (_MSC_VER >= 1900)
187 #  endif // defined(BOOST_ASIO_MSVC)
188 # endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
189 #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
190 #if !defined(BOOST_ASIO_ELLIPSIS)
191 # if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
192 #  define BOOST_ASIO_ELLIPSIS ...
193 # else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
194 #  define BOOST_ASIO_ELLIPSIS
195 # endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
196 #endif // !defined(BOOST_ASIO_ELLIPSIS)
197 
198 // Support deleted functions on compilers known to allow it.
199 #if !defined(BOOST_ASIO_DELETED)
200 # if defined(__GNUC__)
201 #  if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
202 #   if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
203 #    define BOOST_ASIO_DELETED = delete
204 #   endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
205 #  endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
206 # endif // defined(__GNUC__)
207 # if defined(__clang__)
208 #  if __has_feature(__cxx_deleted_functions__)
209 #   define BOOST_ASIO_DELETED = delete
210 #  endif // __has_feature(__cxx_deleted_functions__)
211 # endif // defined(__clang__)
212 # if defined(BOOST_ASIO_MSVC)
213 #  if (_MSC_VER >= 1900)
214 #   define BOOST_ASIO_DELETED = delete
215 #  endif // (_MSC_VER >= 1900)
216 # endif // defined(BOOST_ASIO_MSVC)
217 # if !defined(BOOST_ASIO_DELETED)
218 #  define BOOST_ASIO_DELETED
219 # endif // !defined(BOOST_ASIO_DELETED)
220 #endif // !defined(BOOST_ASIO_DELETED)
221 
222 // Support constexpr on compilers known to allow it.
223 #if !defined(BOOST_ASIO_HAS_CONSTEXPR)
224 # if !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
225 #  if defined(__clang__)
226 #   if __has_feature(__cxx_constexpr__)
227 #    define BOOST_ASIO_HAS_CONSTEXPR 1
228 #   endif // __has_feature(__cxx_constexpr__)
229 #  endif // defined(__clang__)
230 #  if defined(__GNUC__)
231 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
232 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
233 #     define BOOST_ASIO_HAS_CONSTEXPR 1
234 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
235 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
236 #  endif // defined(__GNUC__)
237 #  if defined(BOOST_ASIO_MSVC)
238 #   if (_MSC_VER >= 1900)
239 #    define BOOST_ASIO_HAS_CONSTEXPR 1
240 #   endif // (_MSC_VER >= 1900)
241 #  endif // defined(BOOST_ASIO_MSVC)
242 # endif // !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
243 #endif // !defined(BOOST_ASIO_HAS_CONSTEXPR)
244 #if !defined(BOOST_ASIO_CONSTEXPR)
245 # if defined(BOOST_ASIO_HAS_CONSTEXPR)
246 #  define BOOST_ASIO_CONSTEXPR constexpr
247 # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
248 #  define BOOST_ASIO_CONSTEXPR
249 # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
250 #endif // !defined(BOOST_ASIO_CONSTEXPR)
251 #if !defined(BOOST_ASIO_STATIC_CONSTEXPR)
252 # if defined(BOOST_ASIO_HAS_CONSTEXPR)
253 #  define BOOST_ASIO_STATIC_CONSTEXPR(type, assignment) \
254     static constexpr type assignment
255 # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
256 #  define BOOST_ASIO_STATIC_CONSTEXPR(type, assignment) \
257     static const type assignment
258 # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
259 #endif // !defined(BOOST_ASIO_STATIC_CONSTEXPR)
260 #if !defined(BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT)
261 # if defined(BOOST_ASIO_HAS_CONSTEXPR)
262 #  if defined(__GNUC__)
263 #   if (__GNUC__ >= 8)
264 #    define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
265       static constexpr const type name{}
266 #   else // (__GNUC__ >= 8)
267 #    define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
268       static const type name
269 #   endif // (__GNUC__ >= 8)
270 #  elif defined(BOOST_ASIO_MSVC)
271 #   define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
272      static const type name
273 #  else // defined(BOOST_ASIO_MSVC)
274 #   define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
275      static constexpr const type name{}
276 #  endif // defined(BOOST_ASIO_MSVC)
277 # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
278 #  define BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(type, name) \
279     static const type name
280 # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
281 #endif // !defined(BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT)
282 
283 // Support noexcept on compilers known to allow it.
284 #if !defined(BOOST_ASIO_HAS_NOEXCEPT)
285 # if !defined(BOOST_ASIO_DISABLE_NOEXCEPT)
286 #  if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
287 #   if !defined(BOOST_NO_NOEXCEPT)
288 #    define BOOST_ASIO_HAS_NOEXCEPT 1
289 #   endif // !defined(BOOST_NO_NOEXCEPT)
290 #   define BOOST_ASIO_NOEXCEPT BOOST_NOEXCEPT
291 #   define BOOST_ASIO_NOEXCEPT_OR_NOTHROW BOOST_NOEXCEPT_OR_NOTHROW
292 #   define BOOST_ASIO_NOEXCEPT_IF(c) BOOST_NOEXCEPT_IF(c)
293 #  elif defined(__clang__)
294 #   if __has_feature(__cxx_noexcept__)
295 #    define BOOST_ASIO_HAS_NOEXCEPT 1
296 #   endif // __has_feature(__cxx_noexcept__)
297 #  elif defined(__GNUC__)
298 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
299 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
300 #      define BOOST_ASIO_HAS_NOEXCEPT 1
301 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
302 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
303 #  elif defined(BOOST_ASIO_MSVC)
304 #   if (_MSC_VER >= 1900)
305 #    define BOOST_ASIO_HAS_NOEXCEPT 1
306 #   endif // (_MSC_VER >= 1900)
307 #  endif // defined(BOOST_ASIO_MSVC)
308 # endif // !defined(BOOST_ASIO_DISABLE_NOEXCEPT)
309 # if !defined(BOOST_ASIO_NOEXCEPT)
310 # endif // !defined(BOOST_ASIO_NOEXCEPT)
311 # if !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
312 # endif // !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
313 #endif // !defined(BOOST_ASIO_HAS_NOEXCEPT)
314 #if !defined(BOOST_ASIO_NOEXCEPT)
315 # if defined(BOOST_ASIO_HAS_NOEXCEPT)
316 #  define BOOST_ASIO_NOEXCEPT noexcept(true)
317 # else // defined(BOOST_ASIO_HAS_NOEXCEPT)
318 #  define BOOST_ASIO_NOEXCEPT
319 # endif // defined(BOOST_ASIO_HAS_NOEXCEPT)
320 #endif // !defined(BOOST_ASIO_NOEXCEPT)
321 #if !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
322 # if defined(BOOST_ASIO_HAS_NOEXCEPT)
323 #  define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
324 # else // defined(BOOST_ASIO_HAS_NOEXCEPT)
325 #  define BOOST_ASIO_NOEXCEPT_OR_NOTHROW throw()
326 # endif // defined(BOOST_ASIO_HAS_NOEXCEPT)
327 #endif // !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
328 #if !defined(BOOST_ASIO_NOEXCEPT_IF)
329 # if defined(BOOST_ASIO_HAS_NOEXCEPT)
330 #  define BOOST_ASIO_NOEXCEPT_IF(c) noexcept(c)
331 # else // defined(BOOST_ASIO_HAS_NOEXCEPT)
332 #  define BOOST_ASIO_NOEXCEPT_IF(c)
333 # endif // defined(BOOST_ASIO_HAS_NOEXCEPT)
334 #endif // !defined(BOOST_ASIO_NOEXCEPT_IF)
335 
336 // Support automatic type deduction on compilers known to support it.
337 #if !defined(BOOST_ASIO_HAS_DECLTYPE)
338 # if !defined(BOOST_ASIO_DISABLE_DECLTYPE)
339 #  if defined(__clang__)
340 #   if __has_feature(__cxx_decltype__)
341 #    define BOOST_ASIO_HAS_DECLTYPE 1
342 #   endif // __has_feature(__cxx_decltype__)
343 #  endif // defined(__clang__)
344 #  if defined(__GNUC__)
345 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
346 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
347 #     define BOOST_ASIO_HAS_DECLTYPE 1
348 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
349 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
350 #  endif // defined(__GNUC__)
351 #  if defined(BOOST_ASIO_MSVC)
352 #   if (_MSC_VER >= 1800)
353 #    define BOOST_ASIO_HAS_DECLTYPE 1
354 #   endif // (_MSC_VER >= 1800)
355 #  endif // defined(BOOST_ASIO_MSVC)
356 # endif // !defined(BOOST_ASIO_DISABLE_DECLTYPE)
357 #endif // !defined(BOOST_ASIO_HAS_DECLTYPE)
358 
359 // Support alias templates on compilers known to allow it.
360 #if !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
361 # if !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
362 #  if defined(__clang__)
363 #   if __has_feature(__cxx_alias_templates__)
364 #    define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
365 #   endif // __has_feature(__cxx_alias_templates__)
366 #  endif // defined(__clang__)
367 #  if defined(__GNUC__)
368 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
369 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
370 #     define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
371 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
372 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
373 #  endif // defined(__GNUC__)
374 #  if defined(BOOST_ASIO_MSVC)
375 #   if (_MSC_VER >= 1900)
376 #    define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
377 #   endif // (_MSC_VER >= 1900)
378 #  endif // defined(BOOST_ASIO_MSVC)
379 # endif // !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
380 #endif // !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
381 
382 // Support return type deduction on compilers known to allow it.
383 #if !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
384 # if !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
385 #  if defined(__clang__)
386 #   if __has_feature(__cxx_return_type_deduction__)
387 #    define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
388 #   endif // __has_feature(__cxx_return_type_deduction__)
389 #  elif (__cplusplus >= 201402)
390 #   define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
391 #  elif defined(__cpp_return_type_deduction)
392 #   if (__cpp_return_type_deduction >= 201304)
393 #    define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
394 #   endif // (__cpp_return_type_deduction >= 201304)
395 #  endif // defined(__cpp_return_type_deduction)
396 # endif // !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
397 #endif // !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
398 
399 // Support default function template arguments on compilers known to allow it.
400 #if !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
401 # if !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
402 #  if (__cplusplus >= 201103)
403 #   define BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
404 #  elif defined(BOOST_ASIO_MSVC)
405 #   if (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
406 #    define BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
407 #   endif // (_MSC_VER >= 1900 && _MSVC_LANG >= 201103)
408 #  endif // defined(BOOST_ASIO_MSVC)
409 # endif // !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
410 #endif // !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
411 
412 // Support concepts on compilers known to allow them.
413 #if !defined(BOOST_ASIO_HAS_CONCEPTS)
414 # if !defined(BOOST_ASIO_DISABLE_CONCEPTS)
415 #  if defined(__cpp_concepts)
416 #   define BOOST_ASIO_HAS_CONCEPTS 1
417 #   if (__cpp_concepts >= 201707)
418 #    define BOOST_ASIO_CONCEPT concept
419 #   else // (__cpp_concepts >= 201707)
420 #    define BOOST_ASIO_CONCEPT concept bool
421 #   endif // (__cpp_concepts >= 201707)
422 #  endif // defined(__cpp_concepts)
423 # endif // !defined(BOOST_ASIO_DISABLE_CONCEPTS)
424 #endif // !defined(BOOST_ASIO_HAS_CONCEPTS)
425 
426 // Support template variables on compilers known to allow it.
427 #if !defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
428 # if !defined(BOOST_ASIO_DISABLE_VARIABLE_TEMPLATES)
429 #  if defined(__clang__)
430 #   if (__cplusplus >= 201402)
431 #    if __has_feature(__cxx_variable_templates__)
432 #     define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
433 #    endif // __has_feature(__cxx_variable_templates__)
434 #   endif // (__cplusplus >= 201402)
435 #  endif // defined(__clang__)
436 #  if defined(__GNUC__) && !defined(__INTEL_COMPILER)
437 #   if (__GNUC__ >= 6)
438 #    if (__cplusplus >= 201402)
439 #     define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
440 #    endif // (__cplusplus >= 201402)
441 #   endif // (__GNUC__ >= 6)
442 #  endif // defined(__GNUC__) && !defined(__INTEL_COMPILER)
443 #  if defined(BOOST_ASIO_MSVC)
444 #   if (_MSC_VER >= 1901)
445 #    define BOOST_ASIO_HAS_VARIABLE_TEMPLATES 1
446 #   endif // (_MSC_VER >= 1901)
447 #  endif // defined(BOOST_ASIO_MSVC)
448 # endif // !defined(BOOST_ASIO_DISABLE_VARIABLE_TEMPLATES)
449 #endif // !defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
450 
451 // Support SFINAEd template variables on compilers known to allow it.
452 #if !defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
453 # if !defined(BOOST_ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES)
454 #  if defined(__clang__)
455 #   if (__cplusplus >= 201703)
456 #    if __has_feature(__cxx_variable_templates__)
457 #     define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
458 #    endif // __has_feature(__cxx_variable_templates__)
459 #   endif // (__cplusplus >= 201703)
460 #  endif // defined(__clang__)
461 #  if defined(__GNUC__)
462 #   if ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 8)
463 #    if (__cplusplus >= 201402)
464 #     define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
465 #    endif // (__cplusplus >= 201402)
466 #   endif // ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 8)
467 #  endif // defined(__GNUC__)
468 #  if defined(BOOST_ASIO_MSVC)
469 #   if (_MSC_VER >= 1901)
470 #    define BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES 1
471 #   endif // (_MSC_VER >= 1901)
472 #  endif // defined(BOOST_ASIO_MSVC)
473 # endif // !defined(BOOST_ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES)
474 #endif // !defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
475 
476 // Support SFINAE use of constant expressions on compilers known to allow it.
477 #if !defined(BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
478 # if !defined(BOOST_ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE)
479 #  if defined(__clang__)
480 #   if (__cplusplus >= 201402)
481 #    define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
482 #   endif // (__cplusplus >= 201402)
483 #  endif // defined(__clang__)
484 #  if defined(__GNUC__) && !defined(__INTEL_COMPILER)
485 #   if (__GNUC__ >= 7)
486 #    if (__cplusplus >= 201402)
487 #     define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
488 #    endif // (__cplusplus >= 201402)
489 #   endif // (__GNUC__ >= 7)
490 #  endif // defined(__GNUC__) && !defined(__INTEL_COMPILER)
491 #  if defined(BOOST_ASIO_MSVC)
492 #   if (_MSC_VER >= 1901)
493 #    define BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE 1
494 #   endif // (_MSC_VER >= 1901)
495 #  endif // defined(BOOST_ASIO_MSVC)
496 # endif // !defined(BOOST_ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE)
497 #endif // !defined(BOOST_ASIO_HAS_CONSTANT_EXPRESSION_SFINAE)
498 
499 // Enable workarounds for lack of working expression SFINAE.
500 #if !defined(BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE)
501 # if !defined(BOOST_ASIO_DISABLE_WORKING_EXPRESSION_SFINAE)
502 #  if !defined(BOOST_ASIO_MSVC) && !defined(__INTEL_COMPILER)
503 #   if (__cplusplus >= 201103)
504 #    define BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE 1
505 #   endif // (__cplusplus >= 201103)
506 #  endif // !defined(BOOST_ASIO_MSVC) && !defined(__INTEL_COMPILER)
507 # endif // !defined(BOOST_ASIO_DISABLE_WORKING_EXPRESSION_SFINAE)
508 #endif // !defined(BOOST_ASIO_HAS_WORKING_EXPRESSION_SFINAE)
509 
510 // Support ref-qualified functions on compilers known to allow it.
511 #if !defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
512 # if !defined(BOOST_ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS)
513 #  if defined(__clang__)
514 #   if __has_feature(__cxx_reference_qualified_functions__)
515 #    define BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
516 #   endif // __has_feature(__cxx_reference_qualified_functions__)
517 #  endif // defined(__clang__)
518 #  if defined(__GNUC__)
519 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
520 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
521 #     define BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
522 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
523 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
524 #  endif // defined(__GNUC__)
525 #  if defined(BOOST_ASIO_MSVC)
526 #   if (_MSC_VER >= 1900)
527 #    define BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS 1
528 #   endif // (_MSC_VER >= 1900)
529 #  endif // defined(BOOST_ASIO_MSVC)
530 # endif // !defined(BOOST_ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS)
531 #endif // !defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
532 #if defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
533 # if !defined(BOOST_ASIO_LVALUE_REF_QUAL)
534 #  define BOOST_ASIO_LVALUE_REF_QUAL &
535 # endif // !defined(BOOST_ASIO_LVALUE_REF_QUAL)
536 # if !defined(BOOST_ASIO_RVALUE_REF_QUAL)
537 #  define BOOST_ASIO_RVALUE_REF_QUAL &&
538 # endif // !defined(BOOST_ASIO_RVALUE_REF_QUAL)
539 #else // defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
540 # if !defined(BOOST_ASIO_LVALUE_REF_QUAL)
541 #  define BOOST_ASIO_LVALUE_REF_QUAL
542 # endif // !defined(BOOST_ASIO_LVALUE_REF_QUAL)
543 # if !defined(BOOST_ASIO_RVALUE_REF_QUAL)
544 #  define BOOST_ASIO_RVALUE_REF_QUAL
545 # endif // !defined(BOOST_ASIO_RVALUE_REF_QUAL)
546 #endif // defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
547 
548 // Standard library support for system errors.
549 # if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
550 #  if defined(__clang__)
551 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
552 #    define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
553 #   elif (__cplusplus >= 201103)
554 #    if __has_include(<system_error>)
555 #     define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
556 #    endif // __has_include(<system_error>)
557 #   endif // (__cplusplus >= 201103)
558 #  endif // defined(__clang__)
559 #  if defined(__GNUC__)
560 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
561 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
562 #     define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
563 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
564 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
565 #  endif // defined(__GNUC__)
566 #  if defined(BOOST_ASIO_MSVC)
567 #   if (_MSC_VER >= 1700)
568 #    define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
569 #   endif // (_MSC_VER >= 1700)
570 #  endif // defined(BOOST_ASIO_MSVC)
571 # endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
572 
573 // Compliant C++11 compilers put noexcept specifiers on error_category members.
574 #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
575 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
576 #  define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
577 # elif defined(__clang__)
578 #  if __has_feature(__cxx_noexcept__)
579 #   define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
580 #  endif // __has_feature(__cxx_noexcept__)
581 # elif defined(__GNUC__)
582 #  if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
583 #   if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
584 #     define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
585 #   endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
586 #  endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
587 # elif defined(BOOST_ASIO_MSVC)
588 #  if (_MSC_VER >= 1900)
589 #   define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
590 #  endif // (_MSC_VER >= 1900)
591 # endif // defined(BOOST_ASIO_MSVC)
592 # if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
593 #  define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
594 # endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
595 #endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
596 
597 // Standard library support for arrays.
598 #if !defined(BOOST_ASIO_HAS_STD_ARRAY)
599 # if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
600 #  if defined(__clang__)
601 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
602 #    define BOOST_ASIO_HAS_STD_ARRAY 1
603 #   elif (__cplusplus >= 201103)
604 #    if __has_include(<array>)
605 #     define BOOST_ASIO_HAS_STD_ARRAY 1
606 #    endif // __has_include(<array>)
607 #   endif // (__cplusplus >= 201103)
608 #  endif // defined(__clang__)
609 #  if defined(__GNUC__)
610 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
611 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
612 #     define BOOST_ASIO_HAS_STD_ARRAY 1
613 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
614 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
615 #  endif // defined(__GNUC__)
616 #  if defined(BOOST_ASIO_MSVC)
617 #   if (_MSC_VER >= 1600)
618 #    define BOOST_ASIO_HAS_STD_ARRAY 1
619 #   endif // (_MSC_VER >= 1600)
620 #  endif // defined(BOOST_ASIO_MSVC)
621 # endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
622 #endif // !defined(BOOST_ASIO_HAS_STD_ARRAY)
623 
624 // Standard library support for shared_ptr and weak_ptr.
625 #if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
626 # if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
627 #  if defined(__clang__)
628 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
629 #    define BOOST_ASIO_HAS_STD_SHARED_PTR 1
630 #   elif (__cplusplus >= 201103)
631 #    define BOOST_ASIO_HAS_STD_SHARED_PTR 1
632 #   endif // (__cplusplus >= 201103)
633 #  endif // defined(__clang__)
634 #  if defined(__GNUC__)
635 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
636 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
637 #     define BOOST_ASIO_HAS_STD_SHARED_PTR 1
638 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
639 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
640 #  endif // defined(__GNUC__)
641 #  if defined(BOOST_ASIO_MSVC)
642 #   if (_MSC_VER >= 1600)
643 #    define BOOST_ASIO_HAS_STD_SHARED_PTR 1
644 #   endif // (_MSC_VER >= 1600)
645 #  endif // defined(BOOST_ASIO_MSVC)
646 # endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
647 #endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
648 
649 // Standard library support for allocator_arg_t.
650 #if !defined(BOOST_ASIO_HAS_STD_ALLOCATOR_ARG)
651 # if !defined(BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG)
652 #  if defined(__clang__)
653 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
654 #    define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
655 #   elif (__cplusplus >= 201103)
656 #    define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
657 #   endif // (__cplusplus >= 201103)
658 #  endif // defined(__clang__)
659 #  if defined(__GNUC__)
660 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
661 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
662 #     define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
663 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
664 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
665 #  endif // defined(__GNUC__)
666 #  if defined(BOOST_ASIO_MSVC)
667 #   if (_MSC_VER >= 1600)
668 #    define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
669 #   endif // (_MSC_VER >= 1600)
670 #  endif // defined(BOOST_ASIO_MSVC)
671 # endif // !defined(BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG)
672 #endif // !defined(BOOST_ASIO_HAS_STD_ALLOCATOR_ARG)
673 
674 // Standard library support for atomic operations.
675 #if !defined(BOOST_ASIO_HAS_STD_ATOMIC)
676 # if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
677 #  if defined(__clang__)
678 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
679 #    define BOOST_ASIO_HAS_STD_ATOMIC 1
680 #   elif (__cplusplus >= 201103)
681 #    if __has_include(<atomic>)
682 #     define BOOST_ASIO_HAS_STD_ATOMIC 1
683 #    endif // __has_include(<atomic>)
684 #   elif defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
685 #    if (__clang_major__ >= 10)
686 #     if __has_include(<atomic>)
687 #      define BOOST_ASIO_HAS_STD_ATOMIC 1
688 #     endif // __has_include(<atomic>)
689 #    endif // (__clang_major__ >= 10)
690 #   endif // defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
691 #  endif // defined(__clang__)
692 #  if defined(__GNUC__)
693 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
694 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
695 #     define BOOST_ASIO_HAS_STD_ATOMIC 1
696 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
697 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
698 #  endif // defined(__GNUC__)
699 #  if defined(BOOST_ASIO_MSVC)
700 #   if (_MSC_VER >= 1700)
701 #    define BOOST_ASIO_HAS_STD_ATOMIC 1
702 #   endif // (_MSC_VER >= 1700)
703 #  endif // defined(BOOST_ASIO_MSVC)
704 # endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
705 #endif // !defined(BOOST_ASIO_HAS_STD_ATOMIC)
706 
707 // Standard library support for chrono. Some standard libraries (such as the
708 // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
709 // drafts, rather than the eventually standardised name of steady_clock.
710 #if !defined(BOOST_ASIO_HAS_STD_CHRONO)
711 # if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
712 #  if defined(__clang__)
713 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
714 #    define BOOST_ASIO_HAS_STD_CHRONO 1
715 #   elif (__cplusplus >= 201103)
716 #    if __has_include(<chrono>)
717 #     define BOOST_ASIO_HAS_STD_CHRONO 1
718 #    endif // __has_include(<chrono>)
719 #   endif // (__cplusplus >= 201103)
720 #  endif // defined(__clang__)
721 #  if defined(__GNUC__)
722 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
723 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
724 #     define BOOST_ASIO_HAS_STD_CHRONO 1
725 #     if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
726 #      define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
727 #     endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
728 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
729 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
730 #  endif // defined(__GNUC__)
731 #  if defined(BOOST_ASIO_MSVC)
732 #   if (_MSC_VER >= 1700)
733 #    define BOOST_ASIO_HAS_STD_CHRONO 1
734 #   endif // (_MSC_VER >= 1700)
735 #  endif // defined(BOOST_ASIO_MSVC)
736 # endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
737 #endif // !defined(BOOST_ASIO_HAS_STD_CHRONO)
738 
739 // Boost support for chrono.
740 #if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
741 # if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
742 #  if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
743 #   define BOOST_ASIO_HAS_BOOST_CHRONO 1
744 #  endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
745 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
746 #endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
747 
748 // Some form of chrono library is available.
749 #if !defined(BOOST_ASIO_HAS_CHRONO)
750 # if defined(BOOST_ASIO_HAS_STD_CHRONO) \
751     || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
752 #  define BOOST_ASIO_HAS_CHRONO 1
753 # endif // defined(BOOST_ASIO_HAS_STD_CHRONO)
754         // || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
755 #endif // !defined(BOOST_ASIO_HAS_CHRONO)
756 
757 // Boost support for the DateTime library.
758 #if !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
759 # if !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
760 #  define BOOST_ASIO_HAS_BOOST_DATE_TIME 1
761 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
762 #endif // !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
763 
764 // Standard library support for addressof.
765 #if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
766 # if !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
767 #  if defined(__clang__)
768 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
769 #    define BOOST_ASIO_HAS_STD_ADDRESSOF 1
770 #   elif (__cplusplus >= 201103)
771 #    define BOOST_ASIO_HAS_STD_ADDRESSOF 1
772 #   endif // (__cplusplus >= 201103)
773 #  endif // defined(__clang__)
774 #  if defined(__GNUC__)
775 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
776 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
777 #     define BOOST_ASIO_HAS_STD_ADDRESSOF 1
778 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
779 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
780 #  endif // defined(__GNUC__)
781 #  if defined(BOOST_ASIO_MSVC)
782 #   if (_MSC_VER >= 1700)
783 #    define BOOST_ASIO_HAS_STD_ADDRESSOF 1
784 #   endif // (_MSC_VER >= 1700)
785 #  endif // defined(BOOST_ASIO_MSVC)
786 # endif // !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
787 #endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
788 
789 // Standard library support for the function class.
790 #if !defined(BOOST_ASIO_HAS_STD_FUNCTION)
791 # if !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
792 #  if defined(__clang__)
793 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
794 #    define BOOST_ASIO_HAS_STD_FUNCTION 1
795 #   elif (__cplusplus >= 201103)
796 #    define BOOST_ASIO_HAS_STD_FUNCTION 1
797 #   endif // (__cplusplus >= 201103)
798 #  endif // defined(__clang__)
799 #  if defined(__GNUC__)
800 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
801 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
802 #     define BOOST_ASIO_HAS_STD_FUNCTION 1
803 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
804 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
805 #  endif // defined(__GNUC__)
806 #  if defined(BOOST_ASIO_MSVC)
807 #   if (_MSC_VER >= 1700)
808 #    define BOOST_ASIO_HAS_STD_FUNCTION 1
809 #   endif // (_MSC_VER >= 1700)
810 #  endif // defined(BOOST_ASIO_MSVC)
811 # endif // !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
812 #endif // !defined(BOOST_ASIO_HAS_STD_FUNCTION)
813 
814 // Standard library support for type traits.
815 #if !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
816 # if !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
817 #  if defined(__clang__)
818 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
819 #    define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
820 #   elif (__cplusplus >= 201103)
821 #    if __has_include(<type_traits>)
822 #     define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
823 #    endif // __has_include(<type_traits>)
824 #   endif // (__cplusplus >= 201103)
825 #  endif // defined(__clang__)
826 #  if defined(__GNUC__)
827 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
828 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
829 #     define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
830 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
831 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
832 #  endif // defined(__GNUC__)
833 #  if defined(BOOST_ASIO_MSVC)
834 #   if (_MSC_VER >= 1700)
835 #    define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
836 #   endif // (_MSC_VER >= 1700)
837 #  endif // defined(BOOST_ASIO_MSVC)
838 # endif // !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
839 #endif // !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
840 
841 // Standard library support for the nullptr_t type.
842 #if !defined(BOOST_ASIO_HAS_NULLPTR)
843 # if !defined(BOOST_ASIO_DISABLE_NULLPTR)
844 #  if defined(__clang__)
845 #   if __has_feature(__cxx_nullptr__)
846 #    define BOOST_ASIO_HAS_NULLPTR 1
847 #   endif // __has_feature(__cxx_nullptr__)
848 #  elif defined(__GNUC__)
849 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
850 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
851 #     define BOOST_ASIO_HAS_NULLPTR 1
852 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
853 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
854 #  endif // defined(__GNUC__)
855 #  if defined(BOOST_ASIO_MSVC)
856 #   if (_MSC_VER >= 1700)
857 #    define BOOST_ASIO_HAS_NULLPTR 1
858 #   endif // (_MSC_VER >= 1700)
859 #  endif // defined(BOOST_ASIO_MSVC)
860 # endif // !defined(BOOST_ASIO_DISABLE_NULLPTR)
861 #endif // !defined(BOOST_ASIO_HAS_NULLPTR)
862 
863 // Standard library support for the C++11 allocator additions.
864 #if !defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
865 # if !defined(BOOST_ASIO_DISABLE_CXX11_ALLOCATORS)
866 #  if defined(__clang__)
867 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
868 #    define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
869 #   elif (__cplusplus >= 201103)
870 #    define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
871 #   endif // (__cplusplus >= 201103)
872 #  elif defined(__GNUC__)
873 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
874 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
875 #     define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
876 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
877 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
878 #  endif // defined(__GNUC__)
879 #  if defined(BOOST_ASIO_MSVC)
880 #   if (_MSC_VER >= 1800)
881 #    define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
882 #   endif // (_MSC_VER >= 1800)
883 #  endif // defined(BOOST_ASIO_MSVC)
884 # endif // !defined(BOOST_ASIO_DISABLE_CXX11_ALLOCATORS)
885 #endif // !defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
886 
887 // Standard library support for the cstdint header.
888 #if !defined(BOOST_ASIO_HAS_CSTDINT)
889 # if !defined(BOOST_ASIO_DISABLE_CSTDINT)
890 #  if defined(__clang__)
891 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
892 #    define BOOST_ASIO_HAS_CSTDINT 1
893 #   elif (__cplusplus >= 201103)
894 #    define BOOST_ASIO_HAS_CSTDINT 1
895 #   endif // (__cplusplus >= 201103)
896 #  endif // defined(__clang__)
897 #  if defined(__GNUC__)
898 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
899 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
900 #     define BOOST_ASIO_HAS_CSTDINT 1
901 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
902 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
903 #  endif // defined(__GNUC__)
904 #  if defined(BOOST_ASIO_MSVC)
905 #   if (_MSC_VER >= 1700)
906 #    define BOOST_ASIO_HAS_CSTDINT 1
907 #   endif // (_MSC_VER >= 1700)
908 #  endif // defined(BOOST_ASIO_MSVC)
909 # endif // !defined(BOOST_ASIO_DISABLE_CSTDINT)
910 #endif // !defined(BOOST_ASIO_HAS_CSTDINT)
911 
912 // Standard library support for the thread class.
913 #if !defined(BOOST_ASIO_HAS_STD_THREAD)
914 # if !defined(BOOST_ASIO_DISABLE_STD_THREAD)
915 #  if defined(__clang__)
916 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
917 #    define BOOST_ASIO_HAS_STD_THREAD 1
918 #   elif (__cplusplus >= 201103)
919 #    if __has_include(<thread>)
920 #     define BOOST_ASIO_HAS_STD_THREAD 1
921 #    endif // __has_include(<thread>)
922 #   endif // (__cplusplus >= 201103)
923 #  endif // defined(__clang__)
924 #  if defined(__GNUC__)
925 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
926 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
927 #     define BOOST_ASIO_HAS_STD_THREAD 1
928 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
929 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
930 #  endif // defined(__GNUC__)
931 #  if defined(BOOST_ASIO_MSVC)
932 #   if (_MSC_VER >= 1700)
933 #    define BOOST_ASIO_HAS_STD_THREAD 1
934 #   endif // (_MSC_VER >= 1700)
935 #  endif // defined(BOOST_ASIO_MSVC)
936 # endif // !defined(BOOST_ASIO_DISABLE_STD_THREAD)
937 #endif // !defined(BOOST_ASIO_HAS_STD_THREAD)
938 
939 // Standard library support for the mutex and condition variable classes.
940 #if !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
941 # if !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
942 #  if defined(__clang__)
943 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
944 #    define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
945 #   elif (__cplusplus >= 201103)
946 #    if __has_include(<mutex>)
947 #     define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
948 #    endif // __has_include(<mutex>)
949 #   endif // (__cplusplus >= 201103)
950 #  endif // defined(__clang__)
951 #  if defined(__GNUC__)
952 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
953 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
954 #     define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
955 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
956 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
957 #  endif // defined(__GNUC__)
958 #  if defined(BOOST_ASIO_MSVC)
959 #   if (_MSC_VER >= 1700)
960 #    define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
961 #   endif // (_MSC_VER >= 1700)
962 #  endif // defined(BOOST_ASIO_MSVC)
963 # endif // !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
964 #endif // !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
965 
966 // Standard library support for the call_once function.
967 #if !defined(BOOST_ASIO_HAS_STD_CALL_ONCE)
968 # if !defined(BOOST_ASIO_DISABLE_STD_CALL_ONCE)
969 #  if defined(__clang__)
970 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
971 #    define BOOST_ASIO_HAS_STD_CALL_ONCE 1
972 #   elif (__cplusplus >= 201103)
973 #    if __has_include(<mutex>)
974 #     define BOOST_ASIO_HAS_STD_CALL_ONCE 1
975 #    endif // __has_include(<mutex>)
976 #   endif // (__cplusplus >= 201103)
977 #  endif // defined(__clang__)
978 #  if defined(__GNUC__)
979 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
980 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
981 #     define BOOST_ASIO_HAS_STD_CALL_ONCE 1
982 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
983 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
984 #  endif // defined(__GNUC__)
985 #  if defined(BOOST_ASIO_MSVC)
986 #   if (_MSC_VER >= 1700)
987 #    define BOOST_ASIO_HAS_STD_CALL_ONCE 1
988 #   endif // (_MSC_VER >= 1700)
989 #  endif // defined(BOOST_ASIO_MSVC)
990 # endif // !defined(BOOST_ASIO_DISABLE_STD_CALL_ONCE)
991 #endif // !defined(BOOST_ASIO_HAS_STD_CALL_ONCE)
992 
993 // Standard library support for futures.
994 #if !defined(BOOST_ASIO_HAS_STD_FUTURE)
995 # if !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
996 #  if defined(__clang__)
997 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
998 #    define BOOST_ASIO_HAS_STD_FUTURE 1
999 #   elif (__cplusplus >= 201103)
1000 #    if __has_include(<future>)
1001 #     define BOOST_ASIO_HAS_STD_FUTURE 1
1002 #    endif // __has_include(<future>)
1003 #   endif // (__cplusplus >= 201103)
1004 #  endif // defined(__clang__)
1005 #  if defined(__GNUC__)
1006 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
1007 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1008 #     define BOOST_ASIO_HAS_STD_FUTURE 1
1009 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1010 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
1011 #  endif // defined(__GNUC__)
1012 #  if defined(BOOST_ASIO_MSVC)
1013 #   if (_MSC_VER >= 1700)
1014 #    define BOOST_ASIO_HAS_STD_FUTURE 1
1015 #   endif // (_MSC_VER >= 1700)
1016 #  endif // defined(BOOST_ASIO_MSVC)
1017 # endif // !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
1018 #endif // !defined(BOOST_ASIO_HAS_STD_FUTURE)
1019 
1020 // Standard library support for std::string_view.
1021 #if !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
1022 # if !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
1023 #  if defined(__clang__)
1024 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1025 #    if (__cplusplus >= 201402)
1026 #     if __has_include(<string_view>)
1027 #      define BOOST_ASIO_HAS_STD_STRING_VIEW 1
1028 #     endif // __has_include(<string_view>)
1029 #    endif // (__cplusplus >= 201402)
1030 #   else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1031 #    if (__cplusplus >= 201703)
1032 #     if __has_include(<string_view>)
1033 #      define BOOST_ASIO_HAS_STD_STRING_VIEW 1
1034 #     endif // __has_include(<string_view>)
1035 #    endif // (__cplusplus >= 201703)
1036 #   endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1037 #  elif defined(__GNUC__)
1038 #   if (__GNUC__ >= 7)
1039 #    if (__cplusplus >= 201703)
1040 #     define BOOST_ASIO_HAS_STD_STRING_VIEW 1
1041 #    endif // (__cplusplus >= 201703)
1042 #   endif // (__GNUC__ >= 7)
1043 #  elif defined(BOOST_ASIO_MSVC)
1044 #   if (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
1045 #    define BOOST_ASIO_HAS_STD_STRING_VIEW 1
1046 #   endif // (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
1047 #  endif // defined(BOOST_ASIO_MSVC)
1048 # endif // !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
1049 #endif // !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
1050 
1051 // Standard library support for std::experimental::string_view.
1052 #if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
1053 # if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
1054 #  if defined(__clang__)
1055 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1056 #    if (_LIBCPP_VERSION < 7000)
1057 #     if (__cplusplus >= 201402)
1058 #      if __has_include(<experimental/string_view>)
1059 #       define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
1060 #      endif // __has_include(<experimental/string_view>)
1061 #     endif // (__cplusplus >= 201402)
1062 #    endif // (_LIBCPP_VERSION < 7000)
1063 #   else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1064 #    if (__cplusplus >= 201402)
1065 #     if __has_include(<experimental/string_view>)
1066 #      define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
1067 #     endif // __has_include(<experimental/string_view>)
1068 #    endif // (__cplusplus >= 201402)
1069 #   endif // // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1070 #  endif // defined(__clang__)
1071 #  if defined(__GNUC__)
1072 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
1073 #    if (__cplusplus >= 201402)
1074 #     define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
1075 #    endif // (__cplusplus >= 201402)
1076 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
1077 #  endif // defined(__GNUC__)
1078 # endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
1079 #endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
1080 
1081 // Standard library has a string_view that we can use.
1082 #if !defined(BOOST_ASIO_HAS_STRING_VIEW)
1083 # if !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
1084 #  if defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
1085 #   define BOOST_ASIO_HAS_STRING_VIEW 1
1086 #  elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
1087 #   define BOOST_ASIO_HAS_STRING_VIEW 1
1088 #  endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
1089 # endif // !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
1090 #endif // !defined(BOOST_ASIO_HAS_STRING_VIEW)
1091 
1092 // Standard library support for iostream move construction and assignment.
1093 #if !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
1094 # if !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
1095 #  if defined(__GNUC__)
1096 #   if (__GNUC__ > 4)
1097 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1098 #     define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
1099 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1100 #   endif // (__GNUC__ > 4)
1101 #  endif // defined(__GNUC__)
1102 #  if defined(BOOST_ASIO_MSVC)
1103 #   if (_MSC_VER >= 1700)
1104 #    define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
1105 #   endif // (_MSC_VER >= 1700)
1106 #  endif // defined(BOOST_ASIO_MSVC)
1107 # endif // !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
1108 #endif // !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
1109 
1110 // Standard library has invoke_result (which supersedes result_of).
1111 #if !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
1112 # if !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
1113 #  if defined(BOOST_ASIO_MSVC)
1114 #   if (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
1115 #    define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
1116 #   endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
1117 #  endif // defined(BOOST_ASIO_MSVC)
1118 # endif // !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
1119 #endif // !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
1120 
1121 // Standard library support for std::exception_ptr and std::current_exception.
1122 #if !defined(BOOST_ASIO_HAS_STD_EXCEPTION_PTR)
1123 # if !defined(BOOST_ASIO_DISABLE_STD_EXCEPTION_PTR)
1124 #  if defined(__clang__)
1125 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1126 #    define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
1127 #   elif (__cplusplus >= 201103)
1128 #    define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
1129 #   endif // (__cplusplus >= 201103)
1130 #  elif defined(__GNUC__)
1131 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
1132 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1133 #     define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
1134 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1135 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
1136 #  endif // defined(__GNUC__)
1137 #  if defined(BOOST_ASIO_MSVC)
1138 #   if (_MSC_VER >= 1800)
1139 #    define BOOST_ASIO_HAS_STD_EXCEPTION_PTR 1
1140 #   endif // (_MSC_VER >= 1800)
1141 #  endif // defined(BOOST_ASIO_MSVC)
1142 # endif // !defined(BOOST_ASIO_DISABLE_STD_EXCEPTION_PTR)
1143 #endif // !defined(BOOST_ASIO_HAS_STD_EXCEPTION_PTR)
1144 
1145 // Standard library support for std::nested_exception.
1146 #if !defined(BOOST_ASIO_HAS_STD_NESTED_EXCEPTION)
1147 # if !defined(BOOST_ASIO_DISABLE_STD_NESTED_EXCEPTION)
1148 #  if defined(__clang__)
1149 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1150 #    define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
1151 #   elif (__cplusplus >= 201103)
1152 #    define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
1153 #   endif // (__cplusplus >= 201103)
1154 #  elif defined(__GNUC__)
1155 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
1156 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1157 #     define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
1158 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1159 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
1160 #  endif // defined(__GNUC__)
1161 #  if defined(BOOST_ASIO_MSVC)
1162 #   if (_MSC_VER >= 1900)
1163 #    define BOOST_ASIO_HAS_STD_NESTED_EXCEPTION 1
1164 #   endif // (_MSC_VER >= 1900)
1165 #  endif // defined(BOOST_ASIO_MSVC)
1166 # endif // !defined(BOOST_ASIO_DISABLE_STD_NESTED_EXCEPTION)
1167 #endif // !defined(BOOST_ASIO_HAS_STD_NESTED_EXCEPTION)
1168 
1169 // Standard library support for std::any.
1170 #if !defined(BOOST_ASIO_HAS_STD_ANY)
1171 # if !defined(BOOST_ASIO_DISABLE_STD_ANY)
1172 #  if defined(__clang__)
1173 #   if (__cplusplus >= 201703)
1174 #    if __has_include(<any>)
1175 #     define BOOST_ASIO_HAS_STD_ANY 1
1176 #    endif // __has_include(<any>)
1177 #   endif // (__cplusplus >= 201703)
1178 #  elif defined(__GNUC__)
1179 #   if (__GNUC__ >= 7)
1180 #    if (__cplusplus >= 201703)
1181 #     define BOOST_ASIO_HAS_STD_ANY 1
1182 #    endif // (__cplusplus >= 201703)
1183 #   endif // (__GNUC__ >= 7)
1184 #  endif // defined(__GNUC__)
1185 #  if defined(BOOST_ASIO_MSVC)
1186 #   if (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
1187 #    define BOOST_ASIO_HAS_STD_ANY 1
1188 #   endif // (_MSC_VER >= 1910) && (_MSVC_LANG >= 201703)
1189 #  endif // defined(BOOST_ASIO_MSVC)
1190 # endif // !defined(BOOST_ASIO_DISABLE_STD_ANY)
1191 #endif // !defined(BOOST_ASIO_HAS_STD_ANY)
1192 
1193 // Standard library support for std::source_location.
1194 #if !defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
1195 # if !defined(BOOST_ASIO_DISABLE_STD_SOURCE_LOCATION)
1196 // ...
1197 # endif // !defined(BOOST_ASIO_DISABLE_STD_SOURCE_LOCATION)
1198 #endif // !defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
1199 
1200 // Standard library support for std::experimental::source_location.
1201 #if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
1202 # if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION)
1203 #  if defined(__GNUC__)
1204 #   if (__cplusplus >= 201709)
1205 #    if __has_include(<experimental/source_location>)
1206 #     define BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION 1
1207 #    endif // __has_include(<experimental/source_location>)
1208 #   endif // (__cplusplus >= 201709)
1209 #  endif // defined(__GNUC__)
1210 # endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION)
1211 #endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
1212 
1213 // Standard library has a source_location that we can use.
1214 #if !defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
1215 # if !defined(BOOST_ASIO_DISABLE_SOURCE_LOCATION)
1216 #  if defined(BOOST_ASIO_HAS_STD_SOURCE_LOCATION)
1217 #   define BOOST_ASIO_HAS_SOURCE_LOCATION 1
1218 #  elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
1219 #   define BOOST_ASIO_HAS_SOURCE_LOCATION 1
1220 #  endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION)
1221 # endif // !defined(BOOST_ASIO_DISABLE_SOURCE_LOCATION)
1222 #endif // !defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
1223 
1224 // Windows App target. Windows but with a limited API.
1225 #if !defined(BOOST_ASIO_WINDOWS_APP)
1226 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
1227 #  include <winapifamily.h>
1228 #  if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
1229        || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)) \
1230    && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
1231 #   define BOOST_ASIO_WINDOWS_APP 1
1232 #  endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
1233          // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
1234 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
1235 #endif // !defined(BOOST_ASIO_WINDOWS_APP)
1236 
1237 // Legacy WinRT target. Windows App is preferred.
1238 #if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1239 # if !defined(BOOST_ASIO_WINDOWS_APP)
1240 #  if defined(__cplusplus_winrt)
1241 #   include <winapifamily.h>
1242 #   if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
1243     && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
1244 #    define BOOST_ASIO_WINDOWS_RUNTIME 1
1245 #   endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
1246           // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
1247 #  endif // defined(__cplusplus_winrt)
1248 # endif // !defined(BOOST_ASIO_WINDOWS_APP)
1249 #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1250 
1251 // Windows target. Excludes WinRT but includes Windows App targets.
1252 #if !defined(BOOST_ASIO_WINDOWS)
1253 # if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1254 #  if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
1255 #   define BOOST_ASIO_WINDOWS 1
1256 #  elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
1257 #   define BOOST_ASIO_WINDOWS 1
1258 #  elif defined(BOOST_ASIO_WINDOWS_APP)
1259 #   define BOOST_ASIO_WINDOWS 1
1260 #  endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
1261 # endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1262 #endif // !defined(BOOST_ASIO_WINDOWS)
1263 
1264 // Windows: target OS version.
1265 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1266 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
1267 #  if defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
1268 #   pragma message( \
1269   "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\
1270   "- add -D_WIN32_WINNT=0x0601 to the compiler command line; or\n"\
1271   "- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.\n"\
1272   "Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).")
1273 #  else // defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
1274 #   warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
1275 #   warning For example, add -D_WIN32_WINNT=0x0601 to the compiler command line.
1276 #   warning Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
1277 #  endif // defined(_MSC_VER) || (defined(__BORLANDC__) && !defined(__clang__))
1278 #  define _WIN32_WINNT 0x0601
1279 # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
1280 # if defined(_MSC_VER)
1281 #  if defined(_WIN32) && !defined(WIN32)
1282 #   if !defined(_WINSOCK2API_)
1283 #    define WIN32 // Needed for correct types in winsock2.h
1284 #   else // !defined(_WINSOCK2API_)
1285 #    error Please define the macro WIN32 in your compiler options
1286 #   endif // !defined(_WINSOCK2API_)
1287 #  endif // defined(_WIN32) && !defined(WIN32)
1288 # endif // defined(_MSC_VER)
1289 # if defined(__BORLANDC__)
1290 #  if defined(__WIN32__) && !defined(WIN32)
1291 #   if !defined(_WINSOCK2API_)
1292 #    define WIN32 // Needed for correct types in winsock2.h
1293 #   else // !defined(_WINSOCK2API_)
1294 #    error Please define the macro WIN32 in your compiler options
1295 #   endif // !defined(_WINSOCK2API_)
1296 #  endif // defined(__WIN32__) && !defined(WIN32)
1297 # endif // defined(__BORLANDC__)
1298 # if defined(__CYGWIN__)
1299 #  if !defined(__USE_W32_SOCKETS)
1300 #   error You must add -D__USE_W32_SOCKETS to your compiler options.
1301 #  endif // !defined(__USE_W32_SOCKETS)
1302 # endif // defined(__CYGWIN__)
1303 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1304 
1305 // Windows: minimise header inclusion.
1306 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1307 # if !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
1308 #  if !defined(WIN32_LEAN_AND_MEAN)
1309 #   define WIN32_LEAN_AND_MEAN
1310 #  endif // !defined(WIN32_LEAN_AND_MEAN)
1311 # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
1312 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1313 
1314 // Windows: suppress definition of "min" and "max" macros.
1315 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1316 # if !defined(BOOST_ASIO_NO_NOMINMAX)
1317 #  if !defined(NOMINMAX)
1318 #   define NOMINMAX 1
1319 #  endif // !defined(NOMINMAX)
1320 # endif // !defined(BOOST_ASIO_NO_NOMINMAX)
1321 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1322 
1323 // Windows: IO Completion Ports.
1324 #if !defined(BOOST_ASIO_HAS_IOCP)
1325 # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1326 #  if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
1327 #   if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
1328 #    if !defined(BOOST_ASIO_DISABLE_IOCP)
1329 #     define BOOST_ASIO_HAS_IOCP 1
1330 #    endif // !defined(BOOST_ASIO_DISABLE_IOCP)
1331 #   endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
1332 #  endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
1333 # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1334 #endif // !defined(BOOST_ASIO_HAS_IOCP)
1335 
1336 // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
1337 // get access to the various platform feature macros, e.g. to be able to test
1338 // for threads support.
1339 #if !defined(BOOST_ASIO_HAS_UNISTD_H)
1340 # if !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
1341 #  if defined(unix) \
1342    || defined(__unix) \
1343    || defined(_XOPEN_SOURCE) \
1344    || defined(_POSIX_SOURCE) \
1345    || (defined(__MACH__) && defined(__APPLE__)) \
1346    || defined(__FreeBSD__) \
1347    || defined(__NetBSD__) \
1348    || defined(__OpenBSD__) \
1349    || defined(__linux__) \
1350    || defined(__HAIKU__)
1351 #   define BOOST_ASIO_HAS_UNISTD_H 1
1352 #  endif
1353 # endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
1354 #endif // !defined(BOOST_ASIO_HAS_UNISTD_H)
1355 #if defined(BOOST_ASIO_HAS_UNISTD_H)
1356 # include <unistd.h>
1357 #endif // defined(BOOST_ASIO_HAS_UNISTD_H)
1358 
1359 // Linux: epoll, eventfd and timerfd.
1360 #if defined(__linux__)
1361 # include <linux/version.h>
1362 # if !defined(BOOST_ASIO_HAS_EPOLL)
1363 #  if !defined(BOOST_ASIO_DISABLE_EPOLL)
1364 #   if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
1365 #    define BOOST_ASIO_HAS_EPOLL 1
1366 #   endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
1367 #  endif // !defined(BOOST_ASIO_DISABLE_EPOLL)
1368 # endif // !defined(BOOST_ASIO_HAS_EPOLL)
1369 # if !defined(BOOST_ASIO_HAS_EVENTFD)
1370 #  if !defined(BOOST_ASIO_DISABLE_EVENTFD)
1371 #   if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
1372 #    define BOOST_ASIO_HAS_EVENTFD 1
1373 #   endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
1374 #  endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
1375 # endif // !defined(BOOST_ASIO_HAS_EVENTFD)
1376 # if !defined(BOOST_ASIO_HAS_TIMERFD)
1377 #  if defined(BOOST_ASIO_HAS_EPOLL)
1378 #   if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
1379 #    define BOOST_ASIO_HAS_TIMERFD 1
1380 #   endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
1381 #  endif // defined(BOOST_ASIO_HAS_EPOLL)
1382 # endif // !defined(BOOST_ASIO_HAS_TIMERFD)
1383 #endif // defined(__linux__)
1384 
1385 // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
1386 #if (defined(__MACH__) && defined(__APPLE__)) \
1387   || defined(__FreeBSD__) \
1388   || defined(__NetBSD__) \
1389   || defined(__OpenBSD__)
1390 # if !defined(BOOST_ASIO_HAS_KQUEUE)
1391 #  if !defined(BOOST_ASIO_DISABLE_KQUEUE)
1392 #   define BOOST_ASIO_HAS_KQUEUE 1
1393 #  endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
1394 # endif // !defined(BOOST_ASIO_HAS_KQUEUE)
1395 #endif // (defined(__MACH__) && defined(__APPLE__))
1396        //   || defined(__FreeBSD__)
1397        //   || defined(__NetBSD__)
1398        //   || defined(__OpenBSD__)
1399 
1400 // Solaris: /dev/poll.
1401 #if defined(__sun)
1402 # if !defined(BOOST_ASIO_HAS_DEV_POLL)
1403 #  if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
1404 #   define BOOST_ASIO_HAS_DEV_POLL 1
1405 #  endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
1406 # endif // !defined(BOOST_ASIO_HAS_DEV_POLL)
1407 #endif // defined(__sun)
1408 
1409 // Serial ports.
1410 #if !defined(BOOST_ASIO_HAS_SERIAL_PORT)
1411 # if defined(BOOST_ASIO_HAS_IOCP) \
1412   || !defined(BOOST_ASIO_WINDOWS) \
1413   && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
1414   && !defined(__CYGWIN__)
1415 #  if !defined(__SYMBIAN32__)
1416 #   if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
1417 #    define BOOST_ASIO_HAS_SERIAL_PORT 1
1418 #   endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
1419 #  endif // !defined(__SYMBIAN32__)
1420 # endif // defined(BOOST_ASIO_HAS_IOCP)
1421         //   || !defined(BOOST_ASIO_WINDOWS)
1422         //   && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1423         //   && !defined(__CYGWIN__)
1424 #endif // !defined(BOOST_ASIO_HAS_SERIAL_PORT)
1425 
1426 // Windows: stream handles.
1427 #if !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
1428 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
1429 #  if defined(BOOST_ASIO_HAS_IOCP)
1430 #   define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
1431 #  endif // defined(BOOST_ASIO_HAS_IOCP)
1432 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
1433 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
1434 
1435 // Windows: random access handles.
1436 #if !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
1437 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
1438 #  if defined(BOOST_ASIO_HAS_IOCP)
1439 #   define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
1440 #  endif // defined(BOOST_ASIO_HAS_IOCP)
1441 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
1442 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
1443 
1444 // Windows: object handles.
1445 #if !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
1446 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
1447 #  if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1448 #   if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
1449 #    define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
1450 #   endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
1451 #  endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1452 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
1453 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
1454 
1455 // Windows: OVERLAPPED wrapper.
1456 #if !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
1457 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
1458 #  if defined(BOOST_ASIO_HAS_IOCP)
1459 #   define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
1460 #  endif // defined(BOOST_ASIO_HAS_IOCP)
1461 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
1462 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
1463 
1464 // POSIX: stream-oriented file descriptors.
1465 #if !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
1466 # if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
1467 #  if !defined(BOOST_ASIO_WINDOWS) \
1468   && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
1469   && !defined(__CYGWIN__)
1470 #   define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
1471 #  endif // !defined(BOOST_ASIO_WINDOWS)
1472          //   && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1473          //   && !defined(__CYGWIN__)
1474 # endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
1475 #endif // !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
1476 
1477 // UNIX domain sockets.
1478 #if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
1479 # if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
1480 #  if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1481 #   define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
1482 #  endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1483 # endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
1484 #endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
1485 
1486 // Can use sigaction() instead of signal().
1487 #if !defined(BOOST_ASIO_HAS_SIGACTION)
1488 # if !defined(BOOST_ASIO_DISABLE_SIGACTION)
1489 #  if !defined(BOOST_ASIO_WINDOWS) \
1490   && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
1491   && !defined(__CYGWIN__)
1492 #   define BOOST_ASIO_HAS_SIGACTION 1
1493 #  endif // !defined(BOOST_ASIO_WINDOWS)
1494          //   && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1495          //   && !defined(__CYGWIN__)
1496 # endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
1497 #endif // !defined(BOOST_ASIO_HAS_SIGACTION)
1498 
1499 // Can use signal().
1500 #if !defined(BOOST_ASIO_HAS_SIGNAL)
1501 # if !defined(BOOST_ASIO_DISABLE_SIGNAL)
1502 #  if !defined(UNDER_CE)
1503 #   define BOOST_ASIO_HAS_SIGNAL 1
1504 #  endif // !defined(UNDER_CE)
1505 # endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
1506 #endif // !defined(BOOST_ASIO_HAS_SIGNAL)
1507 
1508 // Can use getaddrinfo() and getnameinfo().
1509 #if !defined(BOOST_ASIO_HAS_GETADDRINFO)
1510 # if !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
1511 #  if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1512 #   if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
1513 #    define BOOST_ASIO_HAS_GETADDRINFO 1
1514 #   elif defined(UNDER_CE)
1515 #    define BOOST_ASIO_HAS_GETADDRINFO 1
1516 #   endif // defined(UNDER_CE)
1517 #  elif defined(__MACH__) && defined(__APPLE__)
1518 #   if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
1519 #    if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
1520 #     define BOOST_ASIO_HAS_GETADDRINFO 1
1521 #    endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
1522 #   else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
1523 #    define BOOST_ASIO_HAS_GETADDRINFO 1
1524 #   endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
1525 #  else // defined(__MACH__) && defined(__APPLE__)
1526 #   define BOOST_ASIO_HAS_GETADDRINFO 1
1527 #  endif // defined(__MACH__) && defined(__APPLE__)
1528 # endif // !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
1529 #endif // !defined(BOOST_ASIO_HAS_GETADDRINFO)
1530 
1531 // Whether standard iostreams are disabled.
1532 #if !defined(BOOST_ASIO_NO_IOSTREAM)
1533 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
1534 #  define BOOST_ASIO_NO_IOSTREAM 1
1535 # endif // !defined(BOOST_NO_IOSTREAM)
1536 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
1537 
1538 // Whether exception handling is disabled.
1539 #if !defined(BOOST_ASIO_NO_EXCEPTIONS)
1540 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
1541 #  define BOOST_ASIO_NO_EXCEPTIONS 1
1542 # endif // !defined(BOOST_NO_EXCEPTIONS)
1543 #endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
1544 
1545 // Whether the typeid operator is supported.
1546 #if !defined(BOOST_ASIO_NO_TYPEID)
1547 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
1548 #  define BOOST_ASIO_NO_TYPEID 1
1549 # endif // !defined(BOOST_NO_TYPEID)
1550 #endif // !defined(BOOST_ASIO_NO_TYPEID)
1551 
1552 // Threads.
1553 #if !defined(BOOST_ASIO_HAS_THREADS)
1554 # if !defined(BOOST_ASIO_DISABLE_THREADS)
1555 #  if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
1556 #   define BOOST_ASIO_HAS_THREADS 1
1557 #  elif defined(__GNUC__) && !defined(__MINGW32__) \
1558      && !defined(linux) && !defined(__linux) && !defined(__linux__)
1559 #   define BOOST_ASIO_HAS_THREADS 1
1560 #  elif defined(_MT) || defined(__MT__)
1561 #   define BOOST_ASIO_HAS_THREADS 1
1562 #  elif defined(_REENTRANT)
1563 #   define BOOST_ASIO_HAS_THREADS 1
1564 #  elif defined(__APPLE__)
1565 #   define BOOST_ASIO_HAS_THREADS 1
1566 #  elif defined(__HAIKU__)
1567 #   define BOOST_ASIO_HAS_THREADS 1
1568 #  elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
1569 #   define BOOST_ASIO_HAS_THREADS 1
1570 #  elif defined(_PTHREADS)
1571 #   define BOOST_ASIO_HAS_THREADS 1
1572 #  endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
1573 # endif // !defined(BOOST_ASIO_DISABLE_THREADS)
1574 #endif // !defined(BOOST_ASIO_HAS_THREADS)
1575 
1576 // POSIX threads.
1577 #if !defined(BOOST_ASIO_HAS_PTHREADS)
1578 # if defined(BOOST_ASIO_HAS_THREADS)
1579 #  if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
1580 #   define BOOST_ASIO_HAS_PTHREADS 1
1581 #  elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
1582 #   define BOOST_ASIO_HAS_PTHREADS 1
1583 #  elif defined(__HAIKU__)
1584 #   define BOOST_ASIO_HAS_PTHREADS 1
1585 #  endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
1586 # endif // defined(BOOST_ASIO_HAS_THREADS)
1587 #endif // !defined(BOOST_ASIO_HAS_PTHREADS)
1588 
1589 // Helper to prevent macro expansion.
1590 #define BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION
1591 
1592 // Helper to define in-class constants.
1593 #if !defined(BOOST_ASIO_STATIC_CONSTANT)
1594 # if !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
1595 #  define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
1596     BOOST_STATIC_CONSTANT(type, assignment)
1597 # else // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
1598 #  define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
1599     static const type assignment
1600 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
1601 #endif // !defined(BOOST_ASIO_STATIC_CONSTANT)
1602 
1603 // Boost array library.
1604 #if !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
1605 # if !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
1606 #  define BOOST_ASIO_HAS_BOOST_ARRAY 1
1607 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
1608 #endif // !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
1609 
1610 // Boost assert macro.
1611 #if !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
1612 # if !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
1613 #  define BOOST_ASIO_HAS_BOOST_ASSERT 1
1614 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
1615 #endif // !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
1616 
1617 // Boost limits header.
1618 #if !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
1619 # if !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
1620 #  define BOOST_ASIO_HAS_BOOST_LIMITS 1
1621 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
1622 #endif // !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
1623 
1624 // Boost throw_exception function.
1625 #if !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
1626 # if !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
1627 #  define BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION 1
1628 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
1629 #endif // !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
1630 
1631 // Boost regex library.
1632 #if !defined(BOOST_ASIO_HAS_BOOST_REGEX)
1633 # if !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
1634 #  define BOOST_ASIO_HAS_BOOST_REGEX 1
1635 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
1636 #endif // !defined(BOOST_ASIO_HAS_BOOST_REGEX)
1637 
1638 // Boost bind function.
1639 #if !defined(BOOST_ASIO_HAS_BOOST_BIND)
1640 # if !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
1641 #  define BOOST_ASIO_HAS_BOOST_BIND 1
1642 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
1643 #endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
1644 
1645 // Boost's BOOST_WORKAROUND macro.
1646 #if !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
1647 # if !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
1648 #  define BOOST_ASIO_HAS_BOOST_WORKAROUND 1
1649 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
1650 #endif // !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
1651 
1652 // Microsoft Visual C++'s secure C runtime library.
1653 #if !defined(BOOST_ASIO_HAS_SECURE_RTL)
1654 # if !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
1655 #  if defined(BOOST_ASIO_MSVC) \
1656     && (BOOST_ASIO_MSVC >= 1400) \
1657     && !defined(UNDER_CE)
1658 #   define BOOST_ASIO_HAS_SECURE_RTL 1
1659 #  endif // defined(BOOST_ASIO_MSVC)
1660          // && (BOOST_ASIO_MSVC >= 1400)
1661          // && !defined(UNDER_CE)
1662 # endif // !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
1663 #endif // !defined(BOOST_ASIO_HAS_SECURE_RTL)
1664 
1665 // Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
1666 #if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
1667 # if !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
1668 #  if defined(__GNUC__)
1669 #   if (__GNUC__ >= 3)
1670 #    define BOOST_ASIO_HAS_HANDLER_HOOKS 1
1671 #   endif // (__GNUC__ >= 3)
1672 #  elif !defined(__BORLANDC__) || defined(__clang__)
1673 #   define BOOST_ASIO_HAS_HANDLER_HOOKS 1
1674 #  endif // !defined(__BORLANDC__) || defined(__clang__)
1675 # endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
1676 #endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
1677 
1678 // Support for the __thread keyword extension.
1679 #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
1680 # if defined(__linux__)
1681 #  if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
1682 #   if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
1683 #    if !defined(__INTEL_COMPILER) && !defined(__ICL) \
1684        && !(defined(__clang__) && defined(__ANDROID__))
1685 #     define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
1686 #     define BOOST_ASIO_THREAD_KEYWORD __thread
1687 #    elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
1688 #     define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
1689 #    endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
1690            // && !(defined(__clang__) && defined(__ANDROID__))
1691 #   endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
1692 #  endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
1693 # endif // defined(__linux__)
1694 # if defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
1695 #  if (_MSC_VER >= 1700)
1696 #   define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
1697 #   define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
1698 #  endif // (_MSC_VER >= 1700)
1699 # endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
1700 #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
1701 #if !defined(BOOST_ASIO_THREAD_KEYWORD)
1702 # define BOOST_ASIO_THREAD_KEYWORD __thread
1703 #endif // !defined(BOOST_ASIO_THREAD_KEYWORD)
1704 
1705 // Support for POSIX ssize_t typedef.
1706 #if !defined(BOOST_ASIO_DISABLE_SSIZE_T)
1707 # if defined(__linux__) \
1708    || (defined(__MACH__) && defined(__APPLE__))
1709 #  define BOOST_ASIO_HAS_SSIZE_T 1
1710 # endif // defined(__linux__)
1711         //   || (defined(__MACH__) && defined(__APPLE__))
1712 #endif // !defined(BOOST_ASIO_DISABLE_SSIZE_T)
1713 
1714 // Helper macros to manage transition away from error_code return values.
1715 #if defined(BOOST_ASIO_NO_DEPRECATED)
1716 # define BOOST_ASIO_SYNC_OP_VOID void
1717 # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return
1718 #else // defined(BOOST_ASIO_NO_DEPRECATED)
1719 # define BOOST_ASIO_SYNC_OP_VOID boost::system::error_code
1720 # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return e
1721 #endif // defined(BOOST_ASIO_NO_DEPRECATED)
1722 
1723 // Newer gcc, clang need special treatment to suppress unused typedef warnings.
1724 #if defined(__clang__)
1725 # if defined(__apple_build_version__)
1726 #  if (__clang_major__ >= 7)
1727 #   define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
1728 #  endif // (__clang_major__ >= 7)
1729 # elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \
1730     || (__clang_major__ > 3)
1731 #  define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
1732 # endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6))
1733         //   || (__clang_major__ > 3)
1734 #elif defined(__GNUC__)
1735 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
1736 #  define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
1737 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
1738 #endif // defined(__GNUC__)
1739 #if !defined(BOOST_ASIO_UNUSED_TYPEDEF)
1740 # define BOOST_ASIO_UNUSED_TYPEDEF
1741 #endif // !defined(BOOST_ASIO_UNUSED_TYPEDEF)
1742 
1743 // Some versions of gcc generate spurious warnings about unused variables.
1744 #if defined(__GNUC__)
1745 # if (__GNUC__ >= 4)
1746 #  define BOOST_ASIO_UNUSED_VARIABLE __attribute__((__unused__))
1747 # endif // (__GNUC__ >= 4)
1748 #endif // defined(__GNUC__)
1749 #if !defined(BOOST_ASIO_UNUSED_VARIABLE)
1750 # define BOOST_ASIO_UNUSED_VARIABLE
1751 #endif // !defined(BOOST_ASIO_UNUSED_VARIABLE)
1752 
1753 // Support the co_await keyword on compilers known to allow it.
1754 #if !defined(BOOST_ASIO_HAS_CO_AWAIT)
1755 # if !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
1756 #  if defined(BOOST_ASIO_MSVC)
1757 #   if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
1758 #    define BOOST_ASIO_HAS_CO_AWAIT 1
1759 #   elif (_MSC_FULL_VER >= 190023506)
1760 #    if defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
1761 #     define BOOST_ASIO_HAS_CO_AWAIT 1
1762 #    endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
1763 #   endif // (_MSC_FULL_VER >= 190023506)
1764 #  endif // defined(BOOST_ASIO_MSVC)
1765 #  if defined(__clang__)
1766 #   if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
1767 #    if __has_include(<experimental/coroutine>)
1768 #     define BOOST_ASIO_HAS_CO_AWAIT 1
1769 #    endif // __has_include(<experimental/coroutine>)
1770 #   endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
1771 #  elif defined(__GNUC__)
1772 #   if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
1773 #    if __has_include(<coroutine>)
1774 #     define BOOST_ASIO_HAS_CO_AWAIT 1
1775 #    endif // __has_include(<coroutine>)
1776 #   endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
1777 #  endif // defined(__GNUC__)
1778 # endif // !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
1779 #endif // !defined(BOOST_ASIO_HAS_CO_AWAIT)
1780 
1781 // Standard library support for coroutines.
1782 #if !defined(BOOST_ASIO_HAS_STD_COROUTINE)
1783 # if !defined(BOOST_ASIO_DISABLE_STD_COROUTINE)
1784 #  if defined(BOOST_ASIO_MSVC)
1785 #   if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
1786 #    define BOOST_ASIO_HAS_STD_COROUTINE 1
1787 #   endif // (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705)
1788 #  endif // defined(BOOST_ASIO_MSVC)
1789 #  if defined(__GNUC__)
1790 #   if (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
1791 #    if __has_include(<coroutine>)
1792 #     define BOOST_ASIO_HAS_STD_COROUTINE 1
1793 #    endif // __has_include(<coroutine>)
1794 #   endif // (__cplusplus >= 201709) && (__cpp_impl_coroutine >= 201902)
1795 #  endif // defined(__GNUC__)
1796 # endif // !defined(BOOST_ASIO_DISABLE_STD_COROUTINE)
1797 #endif // !defined(BOOST_ASIO_HAS_STD_COROUTINE)
1798 
1799 // Compiler support for the the [[nodiscard]] attribute.
1800 #if !defined(BOOST_ASIO_NODISCARD)
1801 # if defined(__has_cpp_attribute)
1802 #  if __has_cpp_attribute(nodiscard)
1803 #   if (__cplusplus >= 201703)
1804 #    define BOOST_ASIO_NODISCARD [[nodiscard]]
1805 #   endif // (__cplusplus >= 201703)
1806 #  endif // __has_cpp_attribute(nodiscard)
1807 # endif // defined(__has_cpp_attribute)
1808 #endif // !defined(BOOST_ASIO_NODISCARD)
1809 #if !defined(BOOST_ASIO_NODISCARD)
1810 # define BOOST_ASIO_NODISCARD
1811 #endif // !defined(BOOST_ASIO_NODISCARD)
1812 
1813 // Kernel support for MSG_NOSIGNAL.
1814 #if !defined(BOOST_ASIO_HAS_MSG_NOSIGNAL)
1815 # if defined(__linux__)
1816 #  define BOOST_ASIO_HAS_MSG_NOSIGNAL 1
1817 # elif defined(_POSIX_VERSION)
1818 #  if (_POSIX_VERSION >= 200809L)
1819 #   define BOOST_ASIO_HAS_MSG_NOSIGNAL 1
1820 #  endif // _POSIX_VERSION >= 200809L
1821 # endif // defined(_POSIX_VERSION)
1822 #endif // !defined(BOOST_ASIO_HAS_MSG_NOSIGNAL)
1823 
1824 // Standard library support for std::hash.
1825 #if !defined(BOOST_ASIO_HAS_STD_HASH)
1826 # if !defined(BOOST_ASIO_DISABLE_STD_HASH)
1827 #  if defined(__clang__)
1828 #   if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
1829 #    define BOOST_ASIO_HAS_STD_HASH 1
1830 #   elif (__cplusplus >= 201103)
1831 #    define BOOST_ASIO_HAS_STD_HASH 1
1832 #   endif // (__cplusplus >= 201103)
1833 #  endif // defined(__clang__)
1834 #  if defined(__GNUC__)
1835 #   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
1836 #    if (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1837 #     define BOOST_ASIO_HAS_STD_HASH 1
1838 #    endif // (__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)
1839 #   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
1840 #  endif // defined(__GNUC__)
1841 #  if defined(BOOST_ASIO_MSVC)
1842 #   if (_MSC_VER >= 1700)
1843 #    define BOOST_ASIO_HAS_STD_HASH 1
1844 #   endif // (_MSC_VER >= 1700)
1845 #  endif // defined(BOOST_ASIO_MSVC)
1846 # endif // !defined(BOOST_ASIO_DISABLE_STD_HASH)
1847 #endif // !defined(BOOST_ASIO_HAS_STD_HASH)
1848 
1849 #endif // BOOST_ASIO_DETAIL_CONFIG_HPP
1850