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