]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/asio/detail/config.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / asio / detail / config.hpp
1 //
2 // detail/config.hpp
3 // ~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2019 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 // Microsoft Visual C++ detection.
65 #if !defined(BOOST_ASIO_MSVC)
66 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
67 # define BOOST_ASIO_MSVC BOOST_MSVC
68 # elif defined(_MSC_VER) && (defined(__INTELLISENSE__) \
69 || (!defined(__MWERKS__) && !defined(__EDG_VERSION__)))
70 # define BOOST_ASIO_MSVC _MSC_VER
71 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
72 #endif // !defined(BOOST_ASIO_MSVC)
73
74 // Clang / libc++ detection.
75 #if defined(__clang__)
76 # if (__cplusplus >= 201103)
77 # if __has_include(<__config>)
78 # include <__config>
79 # if defined(_LIBCPP_VERSION)
80 # define BOOST_ASIO_HAS_CLANG_LIBCXX 1
81 # endif // defined(_LIBCPP_VERSION)
82 # endif // __has_include(<__config>)
83 # endif // (__cplusplus >= 201103)
84 #endif // defined(__clang__)
85
86 // Android platform detection.
87 #if defined(__ANDROID__)
88 # include <android/api-level.h>
89 #endif // defined(__ANDROID__)
90
91 // Support move construction and assignment on compilers known to allow it.
92 #if !defined(BOOST_ASIO_HAS_MOVE)
93 # if !defined(BOOST_ASIO_DISABLE_MOVE)
94 # if defined(__clang__)
95 # if __has_feature(__cxx_rvalue_references__)
96 # define BOOST_ASIO_HAS_MOVE 1
97 # endif // __has_feature(__cxx_rvalue_references__)
98 # endif // defined(__clang__)
99 # if defined(__GNUC__)
100 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
101 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
102 # define BOOST_ASIO_HAS_MOVE 1
103 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
104 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
105 # endif // defined(__GNUC__)
106 # if defined(BOOST_ASIO_MSVC)
107 # if (_MSC_VER >= 1700)
108 # define BOOST_ASIO_HAS_MOVE 1
109 # endif // (_MSC_VER >= 1700)
110 # endif // defined(BOOST_ASIO_MSVC)
111 # if defined(__INTEL_CXX11_MODE__)
112 # if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
113 # define BOOST_ASIO_HAS_MOVE 1
114 # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500)
115 # if defined(__ICL) && (__ICL >= 1500)
116 # define BOOST_ASIO_HAS_MOVE 1
117 # endif // defined(__ICL) && (__ICL >= 1500)
118 # endif // defined(__INTEL_CXX11_MODE__)
119 # endif // !defined(BOOST_ASIO_DISABLE_MOVE)
120 #endif // !defined(BOOST_ASIO_HAS_MOVE)
121
122 // If BOOST_ASIO_MOVE_CAST isn't defined, and move support is available, define
123 // * BOOST_ASIO_MOVE_ARG,
124 // * BOOST_ASIO_NONDEDUCED_MOVE_ARG, and
125 // * BOOST_ASIO_MOVE_CAST
126 // to take advantage of rvalue references and perfect forwarding.
127 #if defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
128 # define BOOST_ASIO_MOVE_ARG(type) type&&
129 # define BOOST_ASIO_MOVE_ARG2(type1, type2) type1, type2&&
130 # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) type&
131 # define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
132 # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
133 #endif // defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
134
135 // If BOOST_ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible
136 // implementation. Note that older g++ and MSVC versions don't like it when you
137 // pass a non-member function through a const reference, so for most compilers
138 // we'll play it safe and stick with the old approach of passing the handler by
139 // value.
140 #if !defined(BOOST_ASIO_MOVE_CAST)
141 # if defined(__GNUC__)
142 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
143 # define BOOST_ASIO_MOVE_ARG(type) const type&
144 # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
145 # define BOOST_ASIO_MOVE_ARG(type) type
146 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
147 # elif defined(BOOST_ASIO_MSVC)
148 # if (_MSC_VER >= 1400)
149 # define BOOST_ASIO_MOVE_ARG(type) const type&
150 # else // (_MSC_VER >= 1400)
151 # define BOOST_ASIO_MOVE_ARG(type) type
152 # endif // (_MSC_VER >= 1400)
153 # else
154 # define BOOST_ASIO_MOVE_ARG(type) type
155 # endif
156 # define BOOST_ASIO_NONDEDUCED_MOVE_ARG(type) const type&
157 # define BOOST_ASIO_MOVE_CAST(type) static_cast<const type&>
158 # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
159 #endif // !defined(BOOST_ASIO_MOVE_CAST)
160
161 // Support variadic templates on compilers known to allow it.
162 #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
163 # if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
164 # if defined(__clang__)
165 # if __has_feature(__cxx_variadic_templates__)
166 # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
167 # endif // __has_feature(__cxx_variadic_templates__)
168 # endif // defined(__clang__)
169 # if defined(__GNUC__)
170 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
171 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
172 # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
173 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
174 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
175 # endif // defined(__GNUC__)
176 # if defined(BOOST_ASIO_MSVC)
177 # if (_MSC_VER >= 1900)
178 # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
179 # endif // (_MSC_VER >= 1900)
180 # endif // defined(BOOST_ASIO_MSVC)
181 # endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
182 #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
183
184 // Support deleted functions on compilers known to allow it.
185 #if !defined(BOOST_ASIO_DELETED)
186 # if defined(__GNUC__)
187 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
188 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
189 # define BOOST_ASIO_DELETED = delete
190 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
191 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
192 # endif // defined(__GNUC__)
193 # if defined(__clang__)
194 # if __has_feature(__cxx_deleted_functions__)
195 # define BOOST_ASIO_DELETED = delete
196 # endif // __has_feature(__cxx_deleted_functions__)
197 # endif // defined(__clang__)
198 # if defined(BOOST_ASIO_MSVC)
199 # if (_MSC_VER >= 1900)
200 # define BOOST_ASIO_DELETED = delete
201 # endif // (_MSC_VER >= 1900)
202 # endif // defined(BOOST_ASIO_MSVC)
203 # if !defined(BOOST_ASIO_DELETED)
204 # define BOOST_ASIO_DELETED
205 # endif // !defined(BOOST_ASIO_DELETED)
206 #endif // !defined(BOOST_ASIO_DELETED)
207
208 // Support constexpr on compilers known to allow it.
209 #if !defined(BOOST_ASIO_HAS_CONSTEXPR)
210 # if !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
211 # if defined(__clang__)
212 # if __has_feature(__cxx_constexpr__)
213 # define BOOST_ASIO_HAS_CONSTEXPR 1
214 # endif // __has_feature(__cxx_constexr__)
215 # endif // defined(__clang__)
216 # if defined(__GNUC__)
217 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
218 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
219 # define BOOST_ASIO_HAS_CONSTEXPR 1
220 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
221 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
222 # endif // defined(__GNUC__)
223 # if defined(BOOST_ASIO_MSVC)
224 # if (_MSC_VER >= 1900)
225 # define BOOST_ASIO_HAS_CONSTEXPR 1
226 # endif // (_MSC_VER >= 1900)
227 # endif // defined(BOOST_ASIO_MSVC)
228 # endif // !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
229 #endif // !defined(BOOST_ASIO_HAS_CONSTEXPR)
230 #if !defined(BOOST_ASIO_CONSTEXPR)
231 # if defined(BOOST_ASIO_HAS_CONSTEXPR)
232 # define BOOST_ASIO_CONSTEXPR constexpr
233 # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
234 # define BOOST_ASIO_CONSTEXPR
235 # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
236 #endif // !defined(BOOST_ASIO_CONSTEXPR)
237
238 // Support noexcept on compilers known to allow it.
239 #if !defined(BOOST_ASIO_NOEXCEPT)
240 # if !defined(BOOST_ASIO_DISABLE_NOEXCEPT)
241 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
242 # define BOOST_ASIO_NOEXCEPT BOOST_NOEXCEPT
243 # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW BOOST_NOEXCEPT_OR_NOTHROW
244 # elif defined(__clang__)
245 # if __has_feature(__cxx_noexcept__)
246 # define BOOST_ASIO_NOEXCEPT noexcept(true)
247 # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
248 # endif // __has_feature(__cxx_noexcept__)
249 # elif defined(__GNUC__)
250 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
251 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
252 # define BOOST_ASIO_NOEXCEPT noexcept(true)
253 # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
254 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
255 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
256 # elif defined(BOOST_ASIO_MSVC)
257 # if (_MSC_VER >= 1900)
258 # define BOOST_ASIO_NOEXCEPT noexcept(true)
259 # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
260 # endif // (_MSC_VER >= 1900)
261 # endif // defined(BOOST_ASIO_MSVC)
262 # endif // !defined(BOOST_ASIO_DISABLE_NOEXCEPT)
263 # if !defined(BOOST_ASIO_NOEXCEPT)
264 # define BOOST_ASIO_NOEXCEPT
265 # endif // !defined(BOOST_ASIO_NOEXCEPT)
266 # if !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
267 # define BOOST_ASIO_NOEXCEPT_OR_NOTHROW throw()
268 # endif // !defined(BOOST_ASIO_NOEXCEPT_OR_NOTHROW)
269 #endif // !defined(BOOST_ASIO_NOEXCEPT)
270
271 // Support automatic type deduction on compilers known to support it.
272 #if !defined(BOOST_ASIO_HAS_DECLTYPE)
273 # if !defined(BOOST_ASIO_DISABLE_DECLTYPE)
274 # if defined(__clang__)
275 # if __has_feature(__cxx_decltype__)
276 # define BOOST_ASIO_HAS_DECLTYPE 1
277 # endif // __has_feature(__cxx_decltype__)
278 # endif // defined(__clang__)
279 # if defined(__GNUC__)
280 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
281 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
282 # define BOOST_ASIO_HAS_DECLTYPE 1
283 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
284 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
285 # endif // defined(__GNUC__)
286 # if defined(BOOST_ASIO_MSVC)
287 # if (_MSC_VER >= 1800)
288 # define BOOST_ASIO_HAS_DECLTYPE 1
289 # endif // (_MSC_VER >= 1800)
290 # endif // defined(BOOST_ASIO_MSVC)
291 # endif // !defined(BOOST_ASIO_DISABLE_DECLTYPE)
292 #endif // !defined(BOOST_ASIO_HAS_DECLTYPE)
293
294 // Support alias templates on compilers known to allow it.
295 #if !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
296 # if !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
297 # if defined(__clang__)
298 # if __has_feature(__cxx_alias_templates__)
299 # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
300 # endif // __has_feature(__cxx_alias_templates__)
301 # endif // defined(__clang__)
302 # if defined(__GNUC__)
303 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
304 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
305 # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
306 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
307 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
308 # endif // defined(__GNUC__)
309 # if defined(BOOST_ASIO_MSVC)
310 # if (_MSC_VER >= 1900)
311 # define BOOST_ASIO_HAS_ALIAS_TEMPLATES 1
312 # endif // (_MSC_VER >= 1900)
313 # endif // defined(BOOST_ASIO_MSVC)
314 # endif // !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
315 #endif // !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
316
317 // Support return type deduction on compilers known to allow it.
318 #if !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
319 # if !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
320 # if defined(__clang__)
321 # if __has_feature(__cxx_return_type_deduction__)
322 # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
323 # endif // __has_feature(__cxx_alias_templates__)
324 # elif (__cplusplus >= 201402)
325 # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
326 # elif defined(__cpp_return_type_deduction)
327 # if (__cpp_return_type_deduction >= 201304)
328 # define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
329 # endif // (__cpp_return_type_deduction >= 201304)
330 # endif // defined(__cpp_return_type_deduction)
331 # endif // !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
332 #endif // !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
333
334 // Support default function template arguments on compilers known to allow it.
335 #if !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
336 # if !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
337 # if (__cplusplus >= 201103)
338 # define BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
339 # endif // (__cplusplus >= 201103)
340 # endif // !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
341 #endif // !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
342
343 // Support concepts on compilers known to allow them.
344 #if !defined(BOOST_ASIO_HAS_CONCEPTS)
345 # if !defined(BOOST_ASIO_DISABLE_CONCEPTS)
346 # if __cpp_concepts
347 # define BOOST_ASIO_HAS_CONCEPTS 1
348 # define BOOST_ASIO_CONCEPT concept bool
349 # endif // __cpp_concepts
350 # endif // !defined(BOOST_ASIO_DISABLE_CONCEPTS)
351 #endif // !defined(BOOST_ASIO_HAS_CONCEPTS)
352
353 // Standard library support for system errors.
354 # if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
355 # if defined(__clang__)
356 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
357 # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
358 # elif (__cplusplus >= 201103)
359 # if __has_include(<system_error>)
360 # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
361 # endif // __has_include(<system_error>)
362 # endif // (__cplusplus >= 201103)
363 # endif // defined(__clang__)
364 # if defined(__GNUC__)
365 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
366 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
367 # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
368 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
369 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
370 # endif // defined(__GNUC__)
371 # if defined(BOOST_ASIO_MSVC)
372 # if (_MSC_VER >= 1700)
373 # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
374 # endif // (_MSC_VER >= 1700)
375 # endif // defined(BOOST_ASIO_MSVC)
376 # endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
377
378 // Compliant C++11 compilers put noexcept specifiers on error_category members.
379 #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
380 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 105300)
381 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
382 # elif defined(__clang__)
383 # if __has_feature(__cxx_noexcept__)
384 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
385 # endif // __has_feature(__cxx_noexcept__)
386 # elif defined(__GNUC__)
387 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
388 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
389 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
390 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
391 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
392 # elif defined(BOOST_ASIO_MSVC)
393 # if (_MSC_VER >= 1900)
394 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
395 # endif // (_MSC_VER >= 1900)
396 # endif // defined(BOOST_ASIO_MSVC)
397 # if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
398 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
399 # endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
400 #endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
401
402 // Standard library support for arrays.
403 #if !defined(BOOST_ASIO_HAS_STD_ARRAY)
404 # if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
405 # if defined(__clang__)
406 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
407 # define BOOST_ASIO_HAS_STD_ARRAY 1
408 # elif (__cplusplus >= 201103)
409 # if __has_include(<array>)
410 # define BOOST_ASIO_HAS_STD_ARRAY 1
411 # endif // __has_include(<array>)
412 # endif // (__cplusplus >= 201103)
413 # endif // defined(__clang__)
414 # if defined(__GNUC__)
415 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
416 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
417 # define BOOST_ASIO_HAS_STD_ARRAY 1
418 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
419 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
420 # endif // defined(__GNUC__)
421 # if defined(BOOST_ASIO_MSVC)
422 # if (_MSC_VER >= 1600)
423 # define BOOST_ASIO_HAS_STD_ARRAY 1
424 # endif // (_MSC_VER >= 1600)
425 # endif // defined(BOOST_ASIO_MSVC)
426 # endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
427 #endif // !defined(BOOST_ASIO_HAS_STD_ARRAY)
428
429 // Standard library support for shared_ptr and weak_ptr.
430 #if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
431 # if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
432 # if defined(__clang__)
433 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
434 # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
435 # elif (__cplusplus >= 201103)
436 # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
437 # endif // (__cplusplus >= 201103)
438 # endif // defined(__clang__)
439 # if defined(__GNUC__)
440 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
441 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
442 # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
443 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
444 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
445 # endif // defined(__GNUC__)
446 # if defined(BOOST_ASIO_MSVC)
447 # if (_MSC_VER >= 1600)
448 # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
449 # endif // (_MSC_VER >= 1600)
450 # endif // defined(BOOST_ASIO_MSVC)
451 # endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
452 #endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
453
454 // Standard library support for allocator_arg_t.
455 #if !defined(BOOST_ASIO_HAS_STD_ALLOCATOR_ARG)
456 # if !defined(BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG)
457 # if defined(__clang__)
458 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
459 # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
460 # elif (__cplusplus >= 201103)
461 # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
462 # endif // (__cplusplus >= 201103)
463 # endif // defined(__clang__)
464 # if defined(__GNUC__)
465 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
466 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
467 # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
468 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
469 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
470 # endif // defined(__GNUC__)
471 # if defined(BOOST_ASIO_MSVC)
472 # if (_MSC_VER >= 1600)
473 # define BOOST_ASIO_HAS_STD_ALLOCATOR_ARG 1
474 # endif // (_MSC_VER >= 1600)
475 # endif // defined(BOOST_ASIO_MSVC)
476 # endif // !defined(BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG)
477 #endif // !defined(BOOST_ASIO_HAS_STD_ALLOCATOR_ARG)
478
479 // Standard library support for atomic operations.
480 #if !defined(BOOST_ASIO_HAS_STD_ATOMIC)
481 # if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
482 # if defined(__clang__)
483 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
484 # define BOOST_ASIO_HAS_STD_ATOMIC 1
485 # elif (__cplusplus >= 201103)
486 # if __has_include(<atomic>)
487 # define BOOST_ASIO_HAS_STD_ATOMIC 1
488 # endif // __has_include(<atomic>)
489 # elif defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
490 # if (__clang_major__ >= 10)
491 # if __has_include(<atomic>)
492 # define BOOST_ASIO_HAS_STD_ATOMIC 1
493 # endif // __has_include(<atomic>)
494 # endif // (__clang_major__ >= 10)
495 # endif /// defined(__apple_build_version__) && defined(_LIBCPP_VERSION)
496 # endif // defined(__clang__)
497 # if defined(__GNUC__)
498 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
499 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
500 # define BOOST_ASIO_HAS_STD_ATOMIC 1
501 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
502 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
503 # endif // defined(__GNUC__)
504 # if defined(BOOST_ASIO_MSVC)
505 # if (_MSC_VER >= 1700)
506 # define BOOST_ASIO_HAS_STD_ATOMIC 1
507 # endif // (_MSC_VER >= 1700)
508 # endif // defined(BOOST_ASIO_MSVC)
509 # endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
510 #endif // !defined(BOOST_ASIO_HAS_STD_ATOMIC)
511
512 // Standard library support for chrono. Some standard libraries (such as the
513 // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
514 // drafts, rather than the eventually standardised name of steady_clock.
515 #if !defined(BOOST_ASIO_HAS_STD_CHRONO)
516 # if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
517 # if defined(__clang__)
518 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
519 # define BOOST_ASIO_HAS_STD_CHRONO 1
520 # elif (__cplusplus >= 201103)
521 # if __has_include(<chrono>)
522 # define BOOST_ASIO_HAS_STD_CHRONO 1
523 # endif // __has_include(<chrono>)
524 # endif // (__cplusplus >= 201103)
525 # endif // defined(__clang__)
526 # if defined(__GNUC__)
527 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
528 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
529 # define BOOST_ASIO_HAS_STD_CHRONO 1
530 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
531 # define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
532 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
533 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
534 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
535 # endif // defined(__GNUC__)
536 # if defined(BOOST_ASIO_MSVC)
537 # if (_MSC_VER >= 1700)
538 # define BOOST_ASIO_HAS_STD_CHRONO 1
539 # endif // (_MSC_VER >= 1700)
540 # endif // defined(BOOST_ASIO_MSVC)
541 # endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
542 #endif // !defined(BOOST_ASIO_HAS_STD_CHRONO)
543
544 // Boost support for chrono.
545 #if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
546 # if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
547 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
548 # define BOOST_ASIO_HAS_BOOST_CHRONO 1
549 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && (BOOST_VERSION >= 104700)
550 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
551 #endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
552
553 // Some form of chrono library is available.
554 #if !defined(BOOST_ASIO_HAS_CHRONO)
555 # if defined(BOOST_ASIO_HAS_STD_CHRONO) \
556 || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
557 # define BOOST_ASIO_HAS_CHRONO 1
558 # endif // defined(BOOST_ASIO_HAS_STD_CHRONO)
559 // || defined(BOOST_ASIO_HAS_BOOST_CHRONO)
560 #endif // !defined(BOOST_ASIO_HAS_CHRONO)
561
562 // Boost support for the DateTime library.
563 #if !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
564 # if !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
565 # define BOOST_ASIO_HAS_BOOST_DATE_TIME 1
566 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
567 #endif // !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
568
569 // Standard library support for addressof.
570 #if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
571 # if !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
572 # if defined(__clang__)
573 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
574 # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
575 # elif (__cplusplus >= 201103)
576 # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
577 # endif // (__cplusplus >= 201103)
578 # endif // defined(__clang__)
579 # if defined(__GNUC__)
580 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
581 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
582 # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
583 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
584 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
585 # endif // defined(__GNUC__)
586 # if defined(BOOST_ASIO_MSVC)
587 # if (_MSC_VER >= 1700)
588 # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
589 # endif // (_MSC_VER >= 1700)
590 # endif // defined(BOOST_ASIO_MSVC)
591 # endif // !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
592 #endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
593
594 // Standard library support for the function class.
595 #if !defined(BOOST_ASIO_HAS_STD_FUNCTION)
596 # if !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
597 # if defined(__clang__)
598 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
599 # define BOOST_ASIO_HAS_STD_FUNCTION 1
600 # elif (__cplusplus >= 201103)
601 # define BOOST_ASIO_HAS_STD_FUNCTION 1
602 # endif // (__cplusplus >= 201103)
603 # endif // defined(__clang__)
604 # if defined(__GNUC__)
605 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
606 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
607 # define BOOST_ASIO_HAS_STD_FUNCTION 1
608 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
609 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
610 # endif // defined(__GNUC__)
611 # if defined(BOOST_ASIO_MSVC)
612 # if (_MSC_VER >= 1700)
613 # define BOOST_ASIO_HAS_STD_FUNCTION 1
614 # endif // (_MSC_VER >= 1700)
615 # endif // defined(BOOST_ASIO_MSVC)
616 # endif // !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
617 #endif // !defined(BOOST_ASIO_HAS_STD_FUNCTION)
618
619 // Standard library support for type traits.
620 #if !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
621 # if !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
622 # if defined(__clang__)
623 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
624 # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
625 # elif (__cplusplus >= 201103)
626 # if __has_include(<type_traits>)
627 # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
628 # endif // __has_include(<type_traits>)
629 # endif // (__cplusplus >= 201103)
630 # endif // defined(__clang__)
631 # if defined(__GNUC__)
632 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
633 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
634 # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
635 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
636 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
637 # endif // defined(__GNUC__)
638 # if defined(BOOST_ASIO_MSVC)
639 # if (_MSC_VER >= 1700)
640 # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
641 # endif // (_MSC_VER >= 1700)
642 # endif // defined(BOOST_ASIO_MSVC)
643 # endif // !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
644 #endif // !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
645
646 // Standard library support for the nullptr_t type.
647 #if !defined(BOOST_ASIO_HAS_NULLPTR)
648 # if !defined(BOOST_ASIO_DISABLE_NULLPTR)
649 # if defined(__clang__)
650 # if __has_feature(__cxx_nullptr__)
651 # define BOOST_ASIO_HAS_NULLPTR 1
652 # endif // __has_feature(__cxx_rvalue_references__)
653 # elif defined(__GNUC__)
654 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
655 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
656 # define BOOST_ASIO_HAS_NULLPTR 1
657 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
658 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
659 # endif // defined(__GNUC__)
660 # if defined(BOOST_ASIO_MSVC)
661 # if (_MSC_VER >= 1700)
662 # define BOOST_ASIO_HAS_NULLPTR 1
663 # endif // (_MSC_VER >= 1700)
664 # endif // defined(BOOST_ASIO_MSVC)
665 # endif // !defined(BOOST_ASIO_DISABLE_NULLPTR)
666 #endif // !defined(BOOST_ASIO_HAS_NULLPTR)
667
668 // Standard library support for the C++11 allocator additions.
669 #if !defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
670 # if !defined(BOOST_ASIO_DISABLE_CXX11_ALLOCATORS)
671 # if defined(__clang__)
672 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
673 # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
674 # elif (__cplusplus >= 201103)
675 # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
676 # endif // (__cplusplus >= 201103)
677 # elif defined(__GNUC__)
678 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
679 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
680 # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
681 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
682 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
683 # endif // defined(__GNUC__)
684 # if defined(BOOST_ASIO_MSVC)
685 # if (_MSC_VER >= 1800)
686 # define BOOST_ASIO_HAS_CXX11_ALLOCATORS 1
687 # endif // (_MSC_VER >= 1800)
688 # endif // defined(BOOST_ASIO_MSVC)
689 # endif // !defined(BOOST_ASIO_DISABLE_CXX11_ALLOCATORS)
690 #endif // !defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
691
692 // Standard library support for the cstdint header.
693 #if !defined(BOOST_ASIO_HAS_CSTDINT)
694 # if !defined(BOOST_ASIO_DISABLE_CSTDINT)
695 # if defined(__clang__)
696 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
697 # define BOOST_ASIO_HAS_CSTDINT 1
698 # elif (__cplusplus >= 201103)
699 # define BOOST_ASIO_HAS_CSTDINT 1
700 # endif // (__cplusplus >= 201103)
701 # endif // defined(__clang__)
702 # if defined(__GNUC__)
703 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
704 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
705 # define BOOST_ASIO_HAS_CSTDINT 1
706 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
707 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
708 # endif // defined(__GNUC__)
709 # if defined(BOOST_ASIO_MSVC)
710 # if (_MSC_VER >= 1700)
711 # define BOOST_ASIO_HAS_CSTDINT 1
712 # endif // (_MSC_VER >= 1700)
713 # endif // defined(BOOST_ASIO_MSVC)
714 # endif // !defined(BOOST_ASIO_DISABLE_CSTDINT)
715 #endif // !defined(BOOST_ASIO_HAS_CSTDINT)
716
717 // Standard library support for the thread class.
718 #if !defined(BOOST_ASIO_HAS_STD_THREAD)
719 # if !defined(BOOST_ASIO_DISABLE_STD_THREAD)
720 # if defined(__clang__)
721 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
722 # define BOOST_ASIO_HAS_STD_THREAD 1
723 # elif (__cplusplus >= 201103)
724 # if __has_include(<thread>)
725 # define BOOST_ASIO_HAS_STD_THREAD 1
726 # endif // __has_include(<thread>)
727 # endif // (__cplusplus >= 201103)
728 # endif // defined(__clang__)
729 # if defined(__GNUC__)
730 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
731 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
732 # define BOOST_ASIO_HAS_STD_THREAD 1
733 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
734 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
735 # endif // defined(__GNUC__)
736 # if defined(BOOST_ASIO_MSVC)
737 # if (_MSC_VER >= 1700)
738 # define BOOST_ASIO_HAS_STD_THREAD 1
739 # endif // (_MSC_VER >= 1700)
740 # endif // defined(BOOST_ASIO_MSVC)
741 # endif // !defined(BOOST_ASIO_DISABLE_STD_THREAD)
742 #endif // !defined(BOOST_ASIO_HAS_STD_THREAD)
743
744 // Standard library support for the mutex and condition variable classes.
745 #if !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
746 # if !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
747 # if defined(__clang__)
748 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
749 # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
750 # elif (__cplusplus >= 201103)
751 # if __has_include(<mutex>)
752 # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
753 # endif // __has_include(<mutex>)
754 # endif // (__cplusplus >= 201103)
755 # endif // defined(__clang__)
756 # if defined(__GNUC__)
757 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
758 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
759 # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
760 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
761 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
762 # endif // defined(__GNUC__)
763 # if defined(BOOST_ASIO_MSVC)
764 # if (_MSC_VER >= 1700)
765 # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
766 # endif // (_MSC_VER >= 1700)
767 # endif // defined(BOOST_ASIO_MSVC)
768 # endif // !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
769 #endif // !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
770
771 // Standard library support for the call_once function.
772 #if !defined(BOOST_ASIO_HAS_STD_CALL_ONCE)
773 # if !defined(BOOST_ASIO_DISABLE_STD_CALL_ONCE)
774 # if defined(__clang__)
775 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
776 # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
777 # elif (__cplusplus >= 201103)
778 # if __has_include(<mutex>)
779 # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
780 # endif // __has_include(<mutex>)
781 # endif // (__cplusplus >= 201103)
782 # endif // defined(__clang__)
783 # if defined(__GNUC__)
784 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
785 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
786 # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
787 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
788 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
789 # endif // defined(__GNUC__)
790 # if defined(BOOST_ASIO_MSVC)
791 # if (_MSC_VER >= 1700)
792 # define BOOST_ASIO_HAS_STD_CALL_ONCE 1
793 # endif // (_MSC_VER >= 1700)
794 # endif // defined(BOOST_ASIO_MSVC)
795 # endif // !defined(BOOST_ASIO_DISABLE_STD_CALL_ONCE)
796 #endif // !defined(BOOST_ASIO_HAS_STD_CALL_ONCE)
797
798 // Standard library support for futures.
799 #if !defined(BOOST_ASIO_HAS_STD_FUTURE)
800 # if !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
801 # if defined(__clang__)
802 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
803 # define BOOST_ASIO_HAS_STD_FUTURE 1
804 # elif (__cplusplus >= 201103)
805 # if __has_include(<future>)
806 # define BOOST_ASIO_HAS_STD_FUTURE 1
807 # endif // __has_include(<mutex>)
808 # endif // (__cplusplus >= 201103)
809 # endif // defined(__clang__)
810 # if defined(__GNUC__)
811 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
812 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
813 # define BOOST_ASIO_HAS_STD_FUTURE 1
814 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
815 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
816 # endif // defined(__GNUC__)
817 # if defined(BOOST_ASIO_MSVC)
818 # if (_MSC_VER >= 1700)
819 # define BOOST_ASIO_HAS_STD_FUTURE 1
820 # endif // (_MSC_VER >= 1700)
821 # endif // defined(BOOST_ASIO_MSVC)
822 # endif // !defined(BOOST_ASIO_DISABLE_STD_FUTURE)
823 #endif // !defined(BOOST_ASIO_HAS_STD_FUTURE)
824
825 // Standard library support for std::string_view.
826 #if !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
827 # if !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
828 # if defined(__clang__)
829 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
830 # if (__cplusplus >= 201402)
831 # if __has_include(<string_view>)
832 # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
833 # endif // __has_include(<string_view>)
834 # endif // (__cplusplus >= 201402)
835 # else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
836 # if (__cplusplus >= 201703)
837 # if __has_include(<string_view>)
838 # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
839 # endif // __has_include(<string_view>)
840 # endif // (__cplusplus >= 201703)
841 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
842 # elif defined(__GNUC__)
843 # if (__GNUC__ >= 7)
844 # if (__cplusplus >= 201703)
845 # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
846 # endif // (__cplusplus >= 201703)
847 # endif // (__GNUC__ >= 7)
848 # elif defined(BOOST_ASIO_MSVC)
849 # if (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
850 # define BOOST_ASIO_HAS_STD_STRING_VIEW 1
851 # endif // (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
852 # endif // defined(BOOST_ASIO_MSVC)
853 # endif // !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
854 #endif // !defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
855
856 // Standard library support for std::experimental::string_view.
857 #if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
858 # if !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
859 # if defined(__clang__)
860 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
861 # if (_LIBCPP_VERSION < 7000)
862 # if (__cplusplus >= 201402)
863 # if __has_include(<experimental/string_view>)
864 # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
865 # endif // __has_include(<experimental/string_view>)
866 # endif // (__cplusplus >= 201402)
867 # endif // (_LIBCPP_VERSION < 7000)
868 # else // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
869 # if (__cplusplus >= 201402)
870 # if __has_include(<experimental/string_view>)
871 # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
872 # endif // __has_include(<experimental/string_view>)
873 # endif // (__cplusplus >= 201402)
874 # endif // // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
875 # endif // defined(__clang__)
876 # if defined(__GNUC__)
877 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
878 # if (__cplusplus >= 201402)
879 # define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
880 # endif // (__cplusplus >= 201402)
881 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
882 # endif // defined(__GNUC__)
883 # endif // !defined(BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
884 #endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
885
886 // Standard library has a string_view that we can use.
887 #if !defined(BOOST_ASIO_HAS_STRING_VIEW)
888 # if !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
889 # if defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
890 # define BOOST_ASIO_HAS_STRING_VIEW 1
891 # elif defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
892 # define BOOST_ASIO_HAS_STRING_VIEW 1
893 # endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
894 # endif // !defined(BOOST_ASIO_DISABLE_STRING_VIEW)
895 #endif // !defined(BOOST_ASIO_HAS_STRING_VIEW)
896
897 // Standard library support for iostream move construction and assignment.
898 #if !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
899 # if !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
900 # if defined(__GNUC__)
901 # if (__GNUC__ > 4)
902 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
903 # define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
904 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
905 # endif // (__GNUC__ > 4)
906 # endif // defined(__GNUC__)
907 # if defined(BOOST_ASIO_MSVC)
908 # if (_MSC_VER >= 1700)
909 # define BOOST_ASIO_HAS_STD_IOSTREAM_MOVE 1
910 # endif // (_MSC_VER >= 1700)
911 # endif // defined(BOOST_ASIO_MSVC)
912 # endif // !defined(BOOST_ASIO_DISABLE_STD_IOSTREAM_MOVE)
913 #endif // !defined(BOOST_ASIO_HAS_STD_IOSTREAM_MOVE)
914
915 // Standard library has invoke_result (which supersedes result_of).
916 #if !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
917 # if !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
918 # if defined(BOOST_ASIO_MSVC)
919 # if (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
920 # define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
921 # endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
922 # endif // defined(BOOST_ASIO_MSVC)
923 # endif // !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
924 #endif // !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
925
926 // Windows App target. Windows but with a limited API.
927 #if !defined(BOOST_ASIO_WINDOWS_APP)
928 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
929 # include <winapifamily.h>
930 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
931 && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
932 # define BOOST_ASIO_WINDOWS_APP 1
933 # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
934 // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
935 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
936 #endif // !defined(BOOST_ASIO_WINDOWS_APP)
937
938 // Legacy WinRT target. Windows App is preferred.
939 #if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
940 # if !defined(BOOST_ASIO_WINDOWS_APP)
941 # if defined(__cplusplus_winrt)
942 # include <winapifamily.h>
943 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
944 && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
945 # define BOOST_ASIO_WINDOWS_RUNTIME 1
946 # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
947 // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
948 # endif // defined(__cplusplus_winrt)
949 # endif // !defined(BOOST_ASIO_WINDOWS_APP)
950 #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
951
952 // Windows target. Excludes WinRT but includes Windows App targets.
953 #if !defined(BOOST_ASIO_WINDOWS)
954 # if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
955 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
956 # define BOOST_ASIO_WINDOWS 1
957 # elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
958 # define BOOST_ASIO_WINDOWS 1
959 # elif defined(BOOST_ASIO_WINDOWS_APP)
960 # define BOOST_ASIO_WINDOWS 1
961 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
962 # endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
963 #endif // !defined(BOOST_ASIO_WINDOWS)
964
965 // Windows: target OS version.
966 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
967 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
968 # if defined(_MSC_VER) || defined(__BORLANDC__)
969 # pragma message( \
970 "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\
971 "- add -D_WIN32_WINNT=0x0601 to the compiler command line; or\n"\
972 "- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.\n"\
973 "Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).")
974 # else // defined(_MSC_VER) || defined(__BORLANDC__)
975 # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
976 # warning For example, add -D_WIN32_WINNT=0x0601 to the compiler command line.
977 # warning Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
978 # endif // defined(_MSC_VER) || defined(__BORLANDC__)
979 # define _WIN32_WINNT 0x0601
980 # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
981 # if defined(_MSC_VER)
982 # if defined(_WIN32) && !defined(WIN32)
983 # if !defined(_WINSOCK2API_)
984 # define WIN32 // Needed for correct types in winsock2.h
985 # else // !defined(_WINSOCK2API_)
986 # error Please define the macro WIN32 in your compiler options
987 # endif // !defined(_WINSOCK2API_)
988 # endif // defined(_WIN32) && !defined(WIN32)
989 # endif // defined(_MSC_VER)
990 # if defined(__BORLANDC__)
991 # if defined(__WIN32__) && !defined(WIN32)
992 # if !defined(_WINSOCK2API_)
993 # define WIN32 // Needed for correct types in winsock2.h
994 # else // !defined(_WINSOCK2API_)
995 # error Please define the macro WIN32 in your compiler options
996 # endif // !defined(_WINSOCK2API_)
997 # endif // defined(__WIN32__) && !defined(WIN32)
998 # endif // defined(__BORLANDC__)
999 # if defined(__CYGWIN__)
1000 # if !defined(__USE_W32_SOCKETS)
1001 # error You must add -D__USE_W32_SOCKETS to your compiler options.
1002 # endif // !defined(__USE_W32_SOCKETS)
1003 # endif // defined(__CYGWIN__)
1004 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1005
1006 // Windows: minimise header inclusion.
1007 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1008 # if !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
1009 # if !defined(WIN32_LEAN_AND_MEAN)
1010 # define WIN32_LEAN_AND_MEAN
1011 # endif // !defined(WIN32_LEAN_AND_MEAN)
1012 # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
1013 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1014
1015 // Windows: suppress definition of "min" and "max" macros.
1016 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1017 # if !defined(BOOST_ASIO_NO_NOMINMAX)
1018 # if !defined(NOMINMAX)
1019 # define NOMINMAX 1
1020 # endif // !defined(NOMINMAX)
1021 # endif // !defined(BOOST_ASIO_NO_NOMINMAX)
1022 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1023
1024 // Windows: IO Completion Ports.
1025 #if !defined(BOOST_ASIO_HAS_IOCP)
1026 # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1027 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
1028 # if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
1029 # if !defined(BOOST_ASIO_DISABLE_IOCP)
1030 # define BOOST_ASIO_HAS_IOCP 1
1031 # endif // !defined(BOOST_ASIO_DISABLE_IOCP)
1032 # endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
1033 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
1034 # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1035 #endif // !defined(BOOST_ASIO_HAS_IOCP)
1036
1037 // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
1038 // get access to the various platform feature macros, e.g. to be able to test
1039 // for threads support.
1040 #if !defined(BOOST_ASIO_HAS_UNISTD_H)
1041 # if !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
1042 # if defined(unix) \
1043 || defined(__unix) \
1044 || defined(_XOPEN_SOURCE) \
1045 || defined(_POSIX_SOURCE) \
1046 || (defined(__MACH__) && defined(__APPLE__)) \
1047 || defined(__FreeBSD__) \
1048 || defined(__NetBSD__) \
1049 || defined(__OpenBSD__) \
1050 || defined(__linux__) \
1051 || defined(__HAIKU__)
1052 # define BOOST_ASIO_HAS_UNISTD_H 1
1053 # endif
1054 # endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
1055 #endif // !defined(BOOST_ASIO_HAS_UNISTD_H)
1056 #if defined(BOOST_ASIO_HAS_UNISTD_H)
1057 # include <unistd.h>
1058 #endif // defined(BOOST_ASIO_HAS_UNISTD_H)
1059
1060 // Linux: epoll, eventfd and timerfd.
1061 #if defined(__linux__)
1062 # include <linux/version.h>
1063 # if !defined(BOOST_ASIO_HAS_EPOLL)
1064 # if !defined(BOOST_ASIO_DISABLE_EPOLL)
1065 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
1066 # define BOOST_ASIO_HAS_EPOLL 1
1067 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
1068 # endif // !defined(BOOST_ASIO_DISABLE_EPOLL)
1069 # endif // !defined(BOOST_ASIO_HAS_EPOLL)
1070 # if !defined(BOOST_ASIO_HAS_EVENTFD)
1071 # if !defined(BOOST_ASIO_DISABLE_EVENTFD)
1072 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
1073 # define BOOST_ASIO_HAS_EVENTFD 1
1074 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
1075 # endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
1076 # endif // !defined(BOOST_ASIO_HAS_EVENTFD)
1077 # if !defined(BOOST_ASIO_HAS_TIMERFD)
1078 # if defined(BOOST_ASIO_HAS_EPOLL)
1079 # if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
1080 # define BOOST_ASIO_HAS_TIMERFD 1
1081 # endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
1082 # endif // defined(BOOST_ASIO_HAS_EPOLL)
1083 # endif // !defined(BOOST_ASIO_HAS_TIMERFD)
1084 #endif // defined(__linux__)
1085
1086 // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
1087 #if (defined(__MACH__) && defined(__APPLE__)) \
1088 || defined(__FreeBSD__) \
1089 || defined(__NetBSD__) \
1090 || defined(__OpenBSD__)
1091 # if !defined(BOOST_ASIO_HAS_KQUEUE)
1092 # if !defined(BOOST_ASIO_DISABLE_KQUEUE)
1093 # define BOOST_ASIO_HAS_KQUEUE 1
1094 # endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
1095 # endif // !defined(BOOST_ASIO_HAS_KQUEUE)
1096 #endif // (defined(__MACH__) && defined(__APPLE__))
1097 // || defined(__FreeBSD__)
1098 // || defined(__NetBSD__)
1099 // || defined(__OpenBSD__)
1100
1101 // Solaris: /dev/poll.
1102 #if defined(__sun)
1103 # if !defined(BOOST_ASIO_HAS_DEV_POLL)
1104 # if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
1105 # define BOOST_ASIO_HAS_DEV_POLL 1
1106 # endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
1107 # endif // !defined(BOOST_ASIO_HAS_DEV_POLL)
1108 #endif // defined(__sun)
1109
1110 // Serial ports.
1111 #if !defined(BOOST_ASIO_HAS_SERIAL_PORT)
1112 # if defined(BOOST_ASIO_HAS_IOCP) \
1113 || !defined(BOOST_ASIO_WINDOWS) \
1114 && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
1115 && !defined(__CYGWIN__)
1116 # if !defined(__SYMBIAN32__)
1117 # if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
1118 # define BOOST_ASIO_HAS_SERIAL_PORT 1
1119 # endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
1120 # endif // !defined(__SYMBIAN32__)
1121 # endif // defined(BOOST_ASIO_HAS_IOCP)
1122 // || !defined(BOOST_ASIO_WINDOWS)
1123 // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1124 // && !defined(__CYGWIN__)
1125 #endif // !defined(BOOST_ASIO_HAS_SERIAL_PORT)
1126
1127 // Windows: stream handles.
1128 #if !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
1129 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
1130 # if defined(BOOST_ASIO_HAS_IOCP)
1131 # define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
1132 # endif // defined(BOOST_ASIO_HAS_IOCP)
1133 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
1134 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
1135
1136 // Windows: random access handles.
1137 #if !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
1138 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
1139 # if defined(BOOST_ASIO_HAS_IOCP)
1140 # define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
1141 # endif // defined(BOOST_ASIO_HAS_IOCP)
1142 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
1143 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
1144
1145 // Windows: object handles.
1146 #if !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
1147 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
1148 # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1149 # if !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
1150 # define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
1151 # endif // !defined(UNDER_CE) && !defined(BOOST_ASIO_WINDOWS_APP)
1152 # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1153 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
1154 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
1155
1156 // Windows: OVERLAPPED wrapper.
1157 #if !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
1158 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
1159 # if defined(BOOST_ASIO_HAS_IOCP)
1160 # define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
1161 # endif // defined(BOOST_ASIO_HAS_IOCP)
1162 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
1163 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
1164
1165 // POSIX: stream-oriented file descriptors.
1166 #if !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
1167 # if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
1168 # if !defined(BOOST_ASIO_WINDOWS) \
1169 && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
1170 && !defined(__CYGWIN__)
1171 # define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
1172 # endif // !defined(BOOST_ASIO_WINDOWS)
1173 // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1174 // && !defined(__CYGWIN__)
1175 # endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
1176 #endif // !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
1177
1178 // UNIX domain sockets.
1179 #if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
1180 # if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
1181 # if !defined(BOOST_ASIO_WINDOWS) \
1182 && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
1183 && !defined(__CYGWIN__)
1184 # define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
1185 # endif // !defined(BOOST_ASIO_WINDOWS)
1186 // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1187 // && !defined(__CYGWIN__)
1188 # endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
1189 #endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
1190
1191 // Can use sigaction() instead of signal().
1192 #if !defined(BOOST_ASIO_HAS_SIGACTION)
1193 # if !defined(BOOST_ASIO_DISABLE_SIGACTION)
1194 # if !defined(BOOST_ASIO_WINDOWS) \
1195 && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
1196 && !defined(__CYGWIN__)
1197 # define BOOST_ASIO_HAS_SIGACTION 1
1198 # endif // !defined(BOOST_ASIO_WINDOWS)
1199 // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
1200 // && !defined(__CYGWIN__)
1201 # endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
1202 #endif // !defined(BOOST_ASIO_HAS_SIGACTION)
1203
1204 // Can use signal().
1205 #if !defined(BOOST_ASIO_HAS_SIGNAL)
1206 # if !defined(BOOST_ASIO_DISABLE_SIGNAL)
1207 # if !defined(UNDER_CE)
1208 # define BOOST_ASIO_HAS_SIGNAL 1
1209 # endif // !defined(UNDER_CE)
1210 # endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
1211 #endif // !defined(BOOST_ASIO_HAS_SIGNAL)
1212
1213 // Can use getaddrinfo() and getnameinfo().
1214 #if !defined(BOOST_ASIO_HAS_GETADDRINFO)
1215 # if !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
1216 # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
1217 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
1218 # define BOOST_ASIO_HAS_GETADDRINFO 1
1219 # elif defined(UNDER_CE)
1220 # define BOOST_ASIO_HAS_GETADDRINFO 1
1221 # endif // defined(UNDER_CE)
1222 # elif defined(__MACH__) && defined(__APPLE__)
1223 # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
1224 # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
1225 # define BOOST_ASIO_HAS_GETADDRINFO 1
1226 # endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)
1227 # else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
1228 # define BOOST_ASIO_HAS_GETADDRINFO 1
1229 # endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
1230 # else // defined(__MACH__) && defined(__APPLE__)
1231 # define BOOST_ASIO_HAS_GETADDRINFO 1
1232 # endif // defined(__MACH__) && defined(__APPLE__)
1233 # endif // !defined(BOOST_ASIO_DISABLE_GETADDRINFO)
1234 #endif // !defined(BOOST_ASIO_HAS_GETADDRINFO)
1235
1236 // Whether standard iostreams are disabled.
1237 #if !defined(BOOST_ASIO_NO_IOSTREAM)
1238 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
1239 # define BOOST_ASIO_NO_IOSTREAM 1
1240 # endif // !defined(BOOST_NO_IOSTREAM)
1241 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
1242
1243 // Whether exception handling is disabled.
1244 #if !defined(BOOST_ASIO_NO_EXCEPTIONS)
1245 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
1246 # define BOOST_ASIO_NO_EXCEPTIONS 1
1247 # endif // !defined(BOOST_NO_EXCEPTIONS)
1248 #endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
1249
1250 // Whether the typeid operator is supported.
1251 #if !defined(BOOST_ASIO_NO_TYPEID)
1252 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
1253 # define BOOST_ASIO_NO_TYPEID 1
1254 # endif // !defined(BOOST_NO_TYPEID)
1255 #endif // !defined(BOOST_ASIO_NO_TYPEID)
1256
1257 // Threads.
1258 #if !defined(BOOST_ASIO_HAS_THREADS)
1259 # if !defined(BOOST_ASIO_DISABLE_THREADS)
1260 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
1261 # define BOOST_ASIO_HAS_THREADS 1
1262 # elif defined(__GNUC__) && !defined(__MINGW32__) \
1263 && !defined(linux) && !defined(__linux) && !defined(__linux__)
1264 # define BOOST_ASIO_HAS_THREADS 1
1265 # elif defined(_MT) || defined(__MT__)
1266 # define BOOST_ASIO_HAS_THREADS 1
1267 # elif defined(_REENTRANT)
1268 # define BOOST_ASIO_HAS_THREADS 1
1269 # elif defined(__APPLE__)
1270 # define BOOST_ASIO_HAS_THREADS 1
1271 # elif defined(__HAIKU__)
1272 # define BOOST_ASIO_HAS_THREADS 1
1273 # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
1274 # define BOOST_ASIO_HAS_THREADS 1
1275 # elif defined(_PTHREADS)
1276 # define BOOST_ASIO_HAS_THREADS 1
1277 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
1278 # endif // !defined(BOOST_ASIO_DISABLE_THREADS)
1279 #endif // !defined(BOOST_ASIO_HAS_THREADS)
1280
1281 // POSIX threads.
1282 #if !defined(BOOST_ASIO_HAS_PTHREADS)
1283 # if defined(BOOST_ASIO_HAS_THREADS)
1284 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
1285 # define BOOST_ASIO_HAS_PTHREADS 1
1286 # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0)
1287 # define BOOST_ASIO_HAS_PTHREADS 1
1288 # elif defined(__HAIKU__)
1289 # define BOOST_ASIO_HAS_PTHREADS 1
1290 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
1291 # endif // defined(BOOST_ASIO_HAS_THREADS)
1292 #endif // !defined(BOOST_ASIO_HAS_PTHREADS)
1293
1294 // Helper to prevent macro expansion.
1295 #define BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION
1296
1297 // Helper to define in-class constants.
1298 #if !defined(BOOST_ASIO_STATIC_CONSTANT)
1299 # if !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
1300 # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
1301 BOOST_STATIC_CONSTANT(type, assignment)
1302 # else // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
1303 # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
1304 static const type assignment
1305 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
1306 #endif // !defined(BOOST_ASIO_STATIC_CONSTANT)
1307
1308 // Boost array library.
1309 #if !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
1310 # if !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
1311 # define BOOST_ASIO_HAS_BOOST_ARRAY 1
1312 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
1313 #endif // !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
1314
1315 // Boost assert macro.
1316 #if !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
1317 # if !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
1318 # define BOOST_ASIO_HAS_BOOST_ASSERT 1
1319 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
1320 #endif // !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
1321
1322 // Boost limits header.
1323 #if !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
1324 # if !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
1325 # define BOOST_ASIO_HAS_BOOST_LIMITS 1
1326 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
1327 #endif // !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
1328
1329 // Boost throw_exception function.
1330 #if !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
1331 # if !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
1332 # define BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION 1
1333 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
1334 #endif // !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
1335
1336 // Boost regex library.
1337 #if !defined(BOOST_ASIO_HAS_BOOST_REGEX)
1338 # if !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
1339 # define BOOST_ASIO_HAS_BOOST_REGEX 1
1340 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
1341 #endif // !defined(BOOST_ASIO_HAS_BOOST_REGEX)
1342
1343 // Boost bind function.
1344 #if !defined(BOOST_ASIO_HAS_BOOST_BIND)
1345 # if !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
1346 # define BOOST_ASIO_HAS_BOOST_BIND 1
1347 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
1348 #endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
1349
1350 // Boost's BOOST_WORKAROUND macro.
1351 #if !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
1352 # if !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
1353 # define BOOST_ASIO_HAS_BOOST_WORKAROUND 1
1354 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
1355 #endif // !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
1356
1357 // Microsoft Visual C++'s secure C runtime library.
1358 #if !defined(BOOST_ASIO_HAS_SECURE_RTL)
1359 # if !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
1360 # if defined(BOOST_ASIO_MSVC) \
1361 && (BOOST_ASIO_MSVC >= 1400) \
1362 && !defined(UNDER_CE)
1363 # define BOOST_ASIO_HAS_SECURE_RTL 1
1364 # endif // defined(BOOST_ASIO_MSVC)
1365 // && (BOOST_ASIO_MSVC >= 1400)
1366 // && !defined(UNDER_CE)
1367 # endif // !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
1368 #endif // !defined(BOOST_ASIO_HAS_SECURE_RTL)
1369
1370 // Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
1371 #if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
1372 # if !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
1373 # if defined(__GNUC__)
1374 # if (__GNUC__ >= 3)
1375 # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
1376 # endif // (__GNUC__ >= 3)
1377 # elif !defined(__BORLANDC__)
1378 # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
1379 # endif // !defined(__BORLANDC__)
1380 # endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
1381 #endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
1382
1383 // Support for the __thread keyword extension.
1384 #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
1385 # if defined(__linux__)
1386 # if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
1387 # if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
1388 # if !defined(__INTEL_COMPILER) && !defined(__ICL) \
1389 && !(defined(__clang__) && defined(__ANDROID__))
1390 # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
1391 # define BOOST_ASIO_THREAD_KEYWORD __thread
1392 # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
1393 # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
1394 # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
1395 // && !(defined(__clang__) && defined(__ANDROID__))
1396 # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
1397 # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
1398 # endif // defined(__linux__)
1399 # if defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
1400 # if (_MSC_VER >= 1700)
1401 # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
1402 # define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
1403 # endif // (_MSC_VER >= 1700)
1404 # endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
1405 #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
1406 #if !defined(BOOST_ASIO_THREAD_KEYWORD)
1407 # define BOOST_ASIO_THREAD_KEYWORD __thread
1408 #endif // !defined(BOOST_ASIO_THREAD_KEYWORD)
1409
1410 // Support for POSIX ssize_t typedef.
1411 #if !defined(BOOST_ASIO_DISABLE_SSIZE_T)
1412 # if defined(__linux__) \
1413 || (defined(__MACH__) && defined(__APPLE__))
1414 # define BOOST_ASIO_HAS_SSIZE_T 1
1415 # endif // defined(__linux__)
1416 // || (defined(__MACH__) && defined(__APPLE__))
1417 #endif // !defined(BOOST_ASIO_DISABLE_SSIZE_T)
1418
1419 // Helper macros to manage transition away from error_code return values.
1420 #if defined(BOOST_ASIO_NO_DEPRECATED)
1421 # define BOOST_ASIO_SYNC_OP_VOID void
1422 # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return
1423 #else // defined(BOOST_ASIO_NO_DEPRECATED)
1424 # define BOOST_ASIO_SYNC_OP_VOID boost::system::error_code
1425 # define BOOST_ASIO_SYNC_OP_VOID_RETURN(e) return e
1426 #endif // defined(BOOST_ASIO_NO_DEPRECATED)
1427
1428 // Newer gcc, clang need special treatment to suppress unused typedef warnings.
1429 #if defined(__clang__)
1430 # if defined(__apple_build_version__)
1431 # if (__clang_major__ >= 7)
1432 # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
1433 # endif // (__clang_major__ >= 7)
1434 # elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \
1435 || (__clang_major__ > 3)
1436 # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
1437 # endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6))
1438 // || (__clang_major__ > 3)
1439 #elif defined(__GNUC__)
1440 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
1441 # define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
1442 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
1443 #endif // defined(__GNUC__)
1444 #if !defined(BOOST_ASIO_UNUSED_TYPEDEF)
1445 # define BOOST_ASIO_UNUSED_TYPEDEF
1446 #endif // !defined(BOOST_ASIO_UNUSED_TYPEDEF)
1447
1448 // Some versions of gcc generate spurious warnings about unused variables.
1449 #if defined(__GNUC__)
1450 # if (__GNUC__ >= 4)
1451 # define BOOST_ASIO_UNUSED_VARIABLE __attribute__((__unused__))
1452 # endif // (__GNUC__ >= 4)
1453 #endif // defined(__GNUC__)
1454 #if !defined(BOOST_ASIO_UNUSED_VARIABLE)
1455 # define BOOST_ASIO_UNUSED_VARIABLE
1456 #endif // !defined(BOOST_ASIO_UNUSED_VARIABLE)
1457
1458 // Support co_await on compilers known to allow it.
1459 #if !defined(BOOST_ASIO_HAS_CO_AWAIT)
1460 # if !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
1461 # if defined(BOOST_ASIO_MSVC)
1462 # if (_MSC_FULL_VER >= 190023506)
1463 # if defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
1464 # define BOOST_ASIO_HAS_CO_AWAIT 1
1465 # endif // defined(_RESUMABLE_FUNCTIONS_SUPPORTED)
1466 # endif // (_MSC_FULL_VER >= 190023506)
1467 # endif // defined(BOOST_ASIO_MSVC)
1468 # endif // !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
1469 # if defined(__clang__)
1470 # if (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
1471 # if __has_include(<experimental/coroutine>)
1472 # define BOOST_ASIO_HAS_CO_AWAIT 1
1473 # endif // __has_include(<experimental/coroutine>)
1474 # endif // (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
1475 # endif // defined(__clang__)
1476 #endif // !defined(BOOST_ASIO_HAS_CO_AWAIT)
1477
1478 #endif // BOOST_ASIO_DETAIL_CONFIG_HPP