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