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