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