comparison DEPENDENCIES/generic/include/boost/asio/detail/config.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 //
2 // detail/config.hpp
3 // ~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10
11 #ifndef BOOST_ASIO_DETAIL_CONFIG_HPP
12 #define BOOST_ASIO_DETAIL_CONFIG_HPP
13
14 #if defined(BOOST_ASIO_STANDALONE)
15 # define BOOST_ASIO_DISABLE_BOOST_ARRAY 1
16 # define BOOST_ASIO_DISABLE_BOOST_ASSERT 1
17 # define BOOST_ASIO_DISABLE_BOOST_BIND 1
18 # define BOOST_ASIO_DISABLE_BOOST_CHRONO 1
19 # define BOOST_ASIO_DISABLE_BOOST_DATE_TIME 1
20 # define BOOST_ASIO_DISABLE_BOOST_LIMITS 1
21 # define BOOST_ASIO_DISABLE_BOOST_REGEX 1
22 # define BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT 1
23 # define BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION 1
24 # define BOOST_ASIO_DISABLE_BOOST_WORKAROUND 1
25 #else // defined(BOOST_ASIO_STANDALONE)
26 # include <boost/config.hpp>
27 # include <boost/version.hpp>
28 # define BOOST_ASIO_HAS_BOOST_CONFIG 1
29 #endif // defined(BOOST_ASIO_STANDALONE)
30
31 // Default to a header-only implementation. The user must specifically request
32 // separate compilation by defining either BOOST_ASIO_SEPARATE_COMPILATION or
33 // BOOST_ASIO_DYN_LINK (as a DLL/shared library implies separate compilation).
34 #if !defined(BOOST_ASIO_HEADER_ONLY)
35 # if !defined(BOOST_ASIO_SEPARATE_COMPILATION)
36 # if !defined(BOOST_ASIO_DYN_LINK)
37 # define BOOST_ASIO_HEADER_ONLY 1
38 # endif // !defined(BOOST_ASIO_DYN_LINK)
39 # endif // !defined(BOOST_ASIO_SEPARATE_COMPILATION)
40 #endif // !defined(BOOST_ASIO_HEADER_ONLY)
41
42 #if defined(BOOST_ASIO_HEADER_ONLY)
43 # define BOOST_ASIO_DECL inline
44 #else // defined(BOOST_ASIO_HEADER_ONLY)
45 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
46 // We need to import/export our code only if the user has specifically asked
47 // for it by defining BOOST_ASIO_DYN_LINK.
48 # if defined(BOOST_ASIO_DYN_LINK)
49 // Export if this is our own source, otherwise import.
50 # if defined(BOOST_ASIO_SOURCE)
51 # define BOOST_ASIO_DECL __declspec(dllexport)
52 # else // defined(BOOST_ASIO_SOURCE)
53 # define BOOST_ASIO_DECL __declspec(dllimport)
54 # endif // defined(BOOST_ASIO_SOURCE)
55 # endif // defined(BOOST_ASIO_DYN_LINK)
56 # endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
57 #endif // defined(BOOST_ASIO_HEADER_ONLY)
58
59 // If BOOST_ASIO_DECL isn't defined yet define it now.
60 #if !defined(BOOST_ASIO_DECL)
61 # define BOOST_ASIO_DECL
62 #endif // !defined(BOOST_ASIO_DECL)
63
64 // Microsoft Visual C++ detection.
65 #if !defined(BOOST_ASIO_MSVC)
66 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
67 # define BOOST_ASIO_MSVC BOOST_MSVC
68 # elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
69 # define BOOST_ASIO_MSVC _MSC_VER
70 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
71 #endif // defined(BOOST_ASIO_MSVC)
72
73 // Clang / libc++ detection.
74 #if defined(__clang__)
75 # if (__cplusplus >= 201103)
76 # if __has_include(<__config>)
77 # include <__config>
78 # if defined(_LIBCPP_VERSION)
79 # define BOOST_ASIO_HAS_CLANG_LIBCXX 1
80 # endif // defined(_LIBCPP_VERSION)
81 # endif // __has_include(<__config>)
82 # endif // (__cplusplus >= 201103)
83 #endif // defined(__clang__)
84
85 // Support move construction and assignment on compilers known to allow it.
86 #if !defined(BOOST_ASIO_HAS_MOVE)
87 # if !defined(BOOST_ASIO_DISABLE_MOVE)
88 # if defined(__clang__)
89 # if __has_feature(__cxx_rvalue_references__)
90 # define BOOST_ASIO_HAS_MOVE 1
91 # endif // __has_feature(__cxx_rvalue_references__)
92 # endif // defined(__clang__)
93 # if defined(__GNUC__)
94 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
95 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
96 # define BOOST_ASIO_HAS_MOVE 1
97 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
98 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
99 # endif // defined(__GNUC__)
100 # if defined(BOOST_ASIO_MSVC)
101 # if (_MSC_VER >= 1700)
102 # define BOOST_ASIO_HAS_MOVE 1
103 # endif // (_MSC_VER >= 1700)
104 # endif // defined(BOOST_ASIO_MSVC)
105 # endif // !defined(BOOST_ASIO_DISABLE_MOVE)
106 #endif // !defined(BOOST_ASIO_HAS_MOVE)
107
108 // If BOOST_ASIO_MOVE_CAST isn't defined, and move support is available, define
109 // BOOST_ASIO_MOVE_ARG and BOOST_ASIO_MOVE_CAST to take advantage of rvalue
110 // references and perfect forwarding.
111 #if defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
112 # define BOOST_ASIO_MOVE_ARG(type) type&&
113 # define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
114 # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
115 #endif // defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
116
117 // If BOOST_ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible
118 // implementation. Note that older g++ and MSVC versions don't like it when you
119 // pass a non-member function through a const reference, so for most compilers
120 // we'll play it safe and stick with the old approach of passing the handler by
121 // value.
122 #if !defined(BOOST_ASIO_MOVE_CAST)
123 # if defined(__GNUC__)
124 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
125 # define BOOST_ASIO_MOVE_ARG(type) const type&
126 # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
127 # define BOOST_ASIO_MOVE_ARG(type) type
128 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
129 # elif defined(BOOST_ASIO_MSVC)
130 # if (_MSC_VER >= 1400)
131 # define BOOST_ASIO_MOVE_ARG(type) const type&
132 # else // (_MSC_VER >= 1400)
133 # define BOOST_ASIO_MOVE_ARG(type) type
134 # endif // (_MSC_VER >= 1400)
135 # else
136 # define BOOST_ASIO_MOVE_ARG(type) type
137 # endif
138 # define BOOST_ASIO_MOVE_CAST(type) static_cast<const type&>
139 # define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
140 #endif // !defined(BOOST_ASIO_MOVE_CAST)
141
142 // Support variadic templates on compilers known to allow it.
143 #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
144 # if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
145 # if defined(__clang__)
146 # if __has_feature(__cxx_variadic_templates__)
147 # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
148 # endif // __has_feature(__cxx_variadic_templates__)
149 # endif // defined(__clang__)
150 # if defined(__GNUC__)
151 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
152 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
153 # define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
154 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
155 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
156 # endif // defined(__GNUC__)
157 # endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
158 #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
159
160 // Support constexpr on compilers known to allow it.
161 #if !defined(BOOST_ASIO_HAS_CONSTEXPR)
162 # if !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
163 # if defined(__clang__)
164 # if __has_feature(__cxx_constexpr__)
165 # define BOOST_ASIO_HAS_CONSTEXPR 1
166 # endif // __has_feature(__cxx_constexr__)
167 # endif // defined(__clang__)
168 # if defined(__GNUC__)
169 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
170 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
171 # define BOOST_ASIO_HAS_CONSTEXPR 1
172 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
173 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
174 # endif // defined(__GNUC__)
175 # endif // !defined(BOOST_ASIO_DISABLE_CONSTEXPR)
176 #endif // !defined(BOOST_ASIO_HAS_CONSTEXPR)
177 #if !defined(BOOST_ASIO_CONSTEXPR)
178 # if defined(BOOST_ASIO_HAS_CONSTEXPR)
179 # define BOOST_ASIO_CONSTEXPR constexpr
180 # else // defined(BOOST_ASIO_HAS_CONSTEXPR)
181 # define BOOST_ASIO_CONSTEXPR
182 # endif // defined(BOOST_ASIO_HAS_CONSTEXPR)
183 #endif // !defined(BOOST_ASIO_CONSTEXPR)
184
185 // Standard library support for system errors.
186 # if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
187 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
188 # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
189 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
190 # if defined(__GNUC__)
191 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
192 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
193 # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
194 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
195 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
196 # endif // defined(__GNUC__)
197 # if defined(BOOST_ASIO_MSVC)
198 # if (_MSC_VER >= 1700)
199 # define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
200 # endif // (_MSC_VER >= 1700)
201 # endif // defined(BOOST_ASIO_MSVC)
202 # endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
203
204 // Compliant C++11 compilers put noexcept specifiers on error_category members.
205 #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
206 # if (BOOST_VERSION >= 105300)
207 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
208 # elif defined(__clang__)
209 # if __has_feature(__cxx_noexcept__)
210 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
211 # endif // __has_feature(__cxx_noexcept__)
212 # elif defined(__GNUC__)
213 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
214 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
215 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
216 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
217 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
218 # endif // defined(__GNUC__)
219 # if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
220 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
221 # endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
222 #endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
223
224 // Standard library support for arrays.
225 #if !defined(BOOST_ASIO_HAS_STD_ARRAY)
226 # if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
227 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
228 # define BOOST_ASIO_HAS_STD_ARRAY 1
229 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
230 # if defined(__GNUC__)
231 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
232 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
233 # define BOOST_ASIO_HAS_STD_ARRAY 1
234 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
235 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
236 # endif // defined(__GNUC__)
237 # if defined(BOOST_ASIO_MSVC)
238 # if (_MSC_VER >= 1600)
239 # define BOOST_ASIO_HAS_STD_ARRAY 1
240 # endif // (_MSC_VER >= 1600)
241 # endif // defined(BOOST_ASIO_MSVC)
242 # endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
243 #endif // !defined(BOOST_ASIO_HAS_STD_ARRAY)
244
245 // Standard library support for shared_ptr and weak_ptr.
246 #if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
247 # if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
248 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
249 # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
250 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
251 # if defined(__GNUC__)
252 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
253 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
254 # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
255 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
256 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
257 # endif // defined(__GNUC__)
258 # if defined(BOOST_ASIO_MSVC)
259 # if (_MSC_VER >= 1600)
260 # define BOOST_ASIO_HAS_STD_SHARED_PTR 1
261 # endif // (_MSC_VER >= 1600)
262 # endif // defined(BOOST_ASIO_MSVC)
263 # endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
264 #endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
265
266 // Standard library support for atomic operations.
267 #if !defined(BOOST_ASIO_HAS_STD_ATOMIC)
268 # if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
269 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
270 # define BOOST_ASIO_HAS_STD_ATOMIC 1
271 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
272 # if defined(__GNUC__)
273 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
274 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
275 # define BOOST_ASIO_HAS_STD_ATOMIC 1
276 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
277 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
278 # endif // defined(__GNUC__)
279 # if defined(BOOST_ASIO_MSVC)
280 # if (_MSC_VER >= 1700)
281 # define BOOST_ASIO_HAS_STD_ATOMIC 1
282 # endif // (_MSC_VER >= 1700)
283 # endif // defined(BOOST_ASIO_MSVC)
284 # endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
285 #endif // !defined(BOOST_ASIO_HAS_STD_ATOMIC)
286
287 // Standard library support for chrono. Some standard libraries (such as the
288 // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
289 // drafts, rather than the eventually standardised name of steady_clock.
290 #if !defined(BOOST_ASIO_HAS_STD_CHRONO)
291 # if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
292 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
293 # define BOOST_ASIO_HAS_STD_CHRONO 1
294 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
295 # if defined(__GNUC__)
296 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
297 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
298 # define BOOST_ASIO_HAS_STD_CHRONO 1
299 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
300 # define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
301 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
302 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
303 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
304 # endif // defined(__GNUC__)
305 # if defined(BOOST_ASIO_MSVC)
306 # if (_MSC_VER >= 1700)
307 # define BOOST_ASIO_HAS_STD_CHRONO 1
308 # endif // (_MSC_VER >= 1700)
309 # endif // defined(BOOST_ASIO_MSVC)
310 # endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
311 #endif // !defined(BOOST_ASIO_HAS_STD_CHRONO)
312
313 // Boost support for chrono.
314 #if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
315 # if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
316 # if (BOOST_VERSION >= 104700)
317 # define BOOST_ASIO_HAS_BOOST_CHRONO 1
318 # endif // (BOOST_VERSION >= 104700)
319 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
320 #endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
321
322 // Boost support for the DateTime library.
323 #if !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
324 # if !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
325 # define BOOST_ASIO_HAS_BOOST_DATE_TIME 1
326 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
327 #endif // !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
328
329 // Standard library support for addressof.
330 #if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
331 # if !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
332 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
333 # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
334 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
335 # if defined(__GNUC__)
336 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
337 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
338 # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
339 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
340 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
341 # endif // defined(__GNUC__)
342 # if defined(BOOST_ASIO_MSVC)
343 # if (_MSC_VER >= 1700)
344 # define BOOST_ASIO_HAS_STD_ADDRESSOF 1
345 # endif // (_MSC_VER >= 1700)
346 # endif // defined(BOOST_ASIO_MSVC)
347 # endif // !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
348 #endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
349
350 // Standard library support for the function class.
351 #if !defined(BOOST_ASIO_HAS_STD_FUNCTION)
352 # if !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
353 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
354 # define BOOST_ASIO_HAS_STD_FUNCTION 1
355 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
356 # if defined(__GNUC__)
357 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
358 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
359 # define BOOST_ASIO_HAS_STD_FUNCTION 1
360 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
361 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
362 # endif // defined(__GNUC__)
363 # if defined(BOOST_ASIO_MSVC)
364 # if (_MSC_VER >= 1700)
365 # define BOOST_ASIO_HAS_STD_FUNCTION 1
366 # endif // (_MSC_VER >= 1700)
367 # endif // defined(BOOST_ASIO_MSVC)
368 # endif // !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
369 #endif // !defined(BOOST_ASIO_HAS_STD_FUNCTION)
370
371 // Standard library support for type traits.
372 #if !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
373 # if !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
374 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
375 # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
376 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
377 # if defined(__GNUC__)
378 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
379 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
380 # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
381 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
382 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
383 # endif // defined(__GNUC__)
384 # if defined(BOOST_ASIO_MSVC)
385 # if (_MSC_VER >= 1700)
386 # define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
387 # endif // (_MSC_VER >= 1700)
388 # endif // defined(BOOST_ASIO_MSVC)
389 # endif // !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
390 #endif // !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
391
392 // Standard library support for the cstdint header.
393 #if !defined(BOOST_ASIO_HAS_CSTDINT)
394 # if !defined(BOOST_ASIO_DISABLE_CSTDINT)
395 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
396 # define BOOST_ASIO_HAS_CSTDINT 1
397 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
398 # if defined(__GNUC__)
399 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
400 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
401 # define BOOST_ASIO_HAS_CSTDINT 1
402 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
403 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
404 # endif // defined(__GNUC__)
405 # if defined(BOOST_ASIO_MSVC)
406 # if (_MSC_VER >= 1700)
407 # define BOOST_ASIO_HAS_CSTDINT 1
408 # endif // (_MSC_VER >= 1700)
409 # endif // defined(BOOST_ASIO_MSVC)
410 # endif // !defined(BOOST_ASIO_DISABLE_CSTDINT)
411 #endif // !defined(BOOST_ASIO_HAS_CSTDINT)
412
413 // Standard library support for the thread class.
414 #if !defined(BOOST_ASIO_HAS_STD_THREAD)
415 # if !defined(BOOST_ASIO_DISABLE_STD_THREAD)
416 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
417 # define BOOST_ASIO_HAS_STD_THREAD 1
418 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
419 # if defined(__GNUC__)
420 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
421 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
422 # define BOOST_ASIO_HAS_STD_THREAD 1
423 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
424 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
425 # endif // defined(__GNUC__)
426 # if defined(BOOST_ASIO_MSVC)
427 # if (_MSC_VER >= 1700)
428 # define BOOST_ASIO_HAS_STD_THREAD 1
429 # endif // (_MSC_VER >= 1700)
430 # endif // defined(BOOST_ASIO_MSVC)
431 # endif // !defined(BOOST_ASIO_DISABLE_STD_THREAD)
432 #endif // !defined(BOOST_ASIO_HAS_STD_THREAD)
433
434 // Standard library support for the mutex and condition variable classes.
435 #if !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
436 # if !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
437 # if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
438 # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
439 # endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
440 # if defined(__GNUC__)
441 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
442 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
443 # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
444 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
445 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
446 # endif // defined(__GNUC__)
447 # if defined(BOOST_ASIO_MSVC)
448 # if (_MSC_VER >= 1700)
449 # define BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
450 # endif // (_MSC_VER >= 1700)
451 # endif // defined(BOOST_ASIO_MSVC)
452 # endif // !defined(BOOST_ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
453 #endif // !defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
454
455 // WinRT target.
456 #if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
457 # if defined(__cplusplus_winrt)
458 # include <winapifamily.h>
459 # if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP)
460 # define BOOST_ASIO_WINDOWS_RUNTIME 1
461 # endif // WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP)
462 # endif // defined(__cplusplus_winrt)
463 #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
464
465 // Windows target. Excludes WinRT.
466 #if !defined(BOOST_ASIO_WINDOWS)
467 # if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
468 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
469 # define BOOST_ASIO_WINDOWS 1
470 # elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
471 # define BOOST_ASIO_WINDOWS 1
472 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
473 # endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
474 #endif // !defined(BOOST_ASIO_WINDOWS)
475
476 // Windows: target OS version.
477 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
478 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
479 # if defined(_MSC_VER) || defined(__BORLANDC__)
480 # pragma message( \
481 "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\
482 "- add -D_WIN32_WINNT=0x0501 to the compiler command line; or\n"\
483 "- add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.\n"\
484 "Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).")
485 # else // defined(_MSC_VER) || defined(__BORLANDC__)
486 # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
487 # warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line.
488 # warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).
489 # endif // defined(_MSC_VER) || defined(__BORLANDC__)
490 # define _WIN32_WINNT 0x0501
491 # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
492 # if defined(_MSC_VER)
493 # if defined(_WIN32) && !defined(WIN32)
494 # if !defined(_WINSOCK2API_)
495 # define WIN32 // Needed for correct types in winsock2.h
496 # else // !defined(_WINSOCK2API_)
497 # error Please define the macro WIN32 in your compiler options
498 # endif // !defined(_WINSOCK2API_)
499 # endif // defined(_WIN32) && !defined(WIN32)
500 # endif // defined(_MSC_VER)
501 # if defined(__BORLANDC__)
502 # if defined(__WIN32__) && !defined(WIN32)
503 # if !defined(_WINSOCK2API_)
504 # define WIN32 // Needed for correct types in winsock2.h
505 # else // !defined(_WINSOCK2API_)
506 # error Please define the macro WIN32 in your compiler options
507 # endif // !defined(_WINSOCK2API_)
508 # endif // defined(__WIN32__) && !defined(WIN32)
509 # endif // defined(__BORLANDC__)
510 # if defined(__CYGWIN__)
511 # if !defined(__USE_W32_SOCKETS)
512 # error You must add -D__USE_W32_SOCKETS to your compiler options.
513 # endif // !defined(__USE_W32_SOCKETS)
514 # endif // defined(__CYGWIN__)
515 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
516
517 // Windows: minimise header inclusion.
518 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
519 # if !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
520 # if !defined(WIN32_LEAN_AND_MEAN)
521 # define WIN32_LEAN_AND_MEAN
522 # endif // !defined(WIN32_LEAN_AND_MEAN)
523 # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
524 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
525
526 // Windows: suppress definition of "min" and "max" macros.
527 #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
528 # if !defined(BOOST_ASIO_NO_NOMINMAX)
529 # if !defined(NOMINMAX)
530 # define NOMINMAX 1
531 # endif // !defined(NOMINMAX)
532 # endif // !defined(BOOST_ASIO_NO_NOMINMAX)
533 #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
534
535 // Windows: IO Completion Ports.
536 #if !defined(BOOST_ASIO_HAS_IOCP)
537 # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
538 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
539 # if !defined(UNDER_CE)
540 # if !defined(BOOST_ASIO_DISABLE_IOCP)
541 # define BOOST_ASIO_HAS_IOCP 1
542 # endif // !defined(BOOST_ASIO_DISABLE_IOCP)
543 # endif // !defined(UNDER_CE)
544 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
545 # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
546 #endif // !defined(BOOST_ASIO_HAS_IOCP)
547
548 // Linux: epoll, eventfd and timerfd.
549 #if defined(__linux__)
550 # include <linux/version.h>
551 # if !defined(BOOST_ASIO_HAS_EPOLL)
552 # if !defined(BOOST_ASIO_DISABLE_EPOLL)
553 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
554 # define BOOST_ASIO_HAS_EPOLL 1
555 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
556 # endif // !defined(BOOST_ASIO_DISABLE_EPOLL)
557 # endif // !defined(BOOST_ASIO_HAS_EPOLL)
558 # if !defined(BOOST_ASIO_HAS_EVENTFD)
559 # if !defined(BOOST_ASIO_DISABLE_EVENTFD)
560 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
561 # define BOOST_ASIO_HAS_EVENTFD 1
562 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
563 # endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
564 # endif // !defined(BOOST_ASIO_HAS_EVENTFD)
565 # if !defined(BOOST_ASIO_HAS_TIMERFD)
566 # if defined(BOOST_ASIO_HAS_EPOLL)
567 # if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
568 # define BOOST_ASIO_HAS_TIMERFD 1
569 # endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
570 # endif // defined(BOOST_ASIO_HAS_EPOLL)
571 # endif // !defined(BOOST_ASIO_HAS_TIMERFD)
572 #endif // defined(__linux__)
573
574 // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
575 #if (defined(__MACH__) && defined(__APPLE__)) \
576 || defined(__FreeBSD__) \
577 || defined(__NetBSD__) \
578 || defined(__OpenBSD__)
579 # if !defined(BOOST_ASIO_HAS_KQUEUE)
580 # if !defined(BOOST_ASIO_DISABLE_KQUEUE)
581 # define BOOST_ASIO_HAS_KQUEUE 1
582 # endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
583 # endif // !defined(BOOST_ASIO_HAS_KQUEUE)
584 #endif // (defined(__MACH__) && defined(__APPLE__))
585 // || defined(__FreeBSD__)
586 // || defined(__NetBSD__)
587 // || defined(__OpenBSD__)
588
589 // Solaris: /dev/poll.
590 #if defined(__sun)
591 # if !defined(BOOST_ASIO_HAS_DEV_POLL)
592 # if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
593 # define BOOST_ASIO_HAS_DEV_POLL 1
594 # endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
595 # endif // !defined(BOOST_ASIO_HAS_DEV_POLL)
596 #endif // defined(__sun)
597
598 // Serial ports.
599 #if !defined(BOOST_ASIO_HAS_SERIAL_PORT)
600 # if defined(BOOST_ASIO_HAS_IOCP) \
601 || !defined(BOOST_ASIO_WINDOWS) \
602 && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
603 && !defined(__CYGWIN__)
604 # if !defined(__SYMBIAN32__)
605 # if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
606 # define BOOST_ASIO_HAS_SERIAL_PORT 1
607 # endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
608 # endif // !defined(__SYMBIAN32__)
609 # endif // defined(BOOST_ASIO_HAS_IOCP)
610 // || !defined(BOOST_ASIO_WINDOWS)
611 // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
612 // && !defined(__CYGWIN__)
613 #endif // !defined(BOOST_ASIO_HAS_SERIAL_PORT)
614
615 // Windows: stream handles.
616 #if !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
617 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
618 # if defined(BOOST_ASIO_HAS_IOCP)
619 # define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
620 # endif // defined(BOOST_ASIO_HAS_IOCP)
621 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
622 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
623
624 // Windows: random access handles.
625 #if !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
626 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
627 # if defined(BOOST_ASIO_HAS_IOCP)
628 # define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
629 # endif // defined(BOOST_ASIO_HAS_IOCP)
630 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
631 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
632
633 // Windows: object handles.
634 #if !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
635 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
636 # if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
637 # if !defined(UNDER_CE)
638 # define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
639 # endif // !defined(UNDER_CE)
640 # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
641 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
642 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
643
644 // Windows: OVERLAPPED wrapper.
645 #if !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
646 # if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
647 # if defined(BOOST_ASIO_HAS_IOCP)
648 # define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
649 # endif // defined(BOOST_ASIO_HAS_IOCP)
650 # endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
651 #endif // !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
652
653 // POSIX: stream-oriented file descriptors.
654 #if !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
655 # if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
656 # if !defined(BOOST_ASIO_WINDOWS) \
657 && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
658 && !defined(__CYGWIN__)
659 # define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
660 # endif // !defined(BOOST_ASIO_WINDOWS)
661 // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
662 // && !defined(__CYGWIN__)
663 # endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
664 #endif // !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
665
666 // UNIX domain sockets.
667 #if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
668 # if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
669 # if !defined(BOOST_ASIO_WINDOWS) \
670 && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
671 && !defined(__CYGWIN__)
672 # define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
673 # endif // !defined(BOOST_ASIO_WINDOWS)
674 // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
675 // && !defined(__CYGWIN__)
676 # endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
677 #endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
678
679 // Can use sigaction() instead of signal().
680 #if !defined(BOOST_ASIO_HAS_SIGACTION)
681 # if !defined(BOOST_ASIO_DISABLE_SIGACTION)
682 # if !defined(BOOST_ASIO_WINDOWS) \
683 && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
684 && !defined(__CYGWIN__)
685 # define BOOST_ASIO_HAS_SIGACTION 1
686 # endif // !defined(BOOST_ASIO_WINDOWS)
687 // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
688 // && !defined(__CYGWIN__)
689 # endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
690 #endif // !defined(BOOST_ASIO_HAS_SIGACTION)
691
692 // Can use signal().
693 #if !defined(BOOST_ASIO_HAS_SIGNAL)
694 # if !defined(BOOST_ASIO_DISABLE_SIGNAL)
695 # if !defined(UNDER_CE)
696 # define BOOST_ASIO_HAS_SIGNAL 1
697 # endif // !defined(UNDER_CE)
698 # endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
699 #endif // !defined(BOOST_ASIO_HAS_SIGNAL)
700
701 // Whether standard iostreams are disabled.
702 #if !defined(BOOST_ASIO_NO_IOSTREAM)
703 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
704 # define BOOST_ASIO_NO_IOSTREAM 1
705 # endif // !defined(BOOST_NO_IOSTREAM)
706 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
707
708 // Whether exception handling is disabled.
709 #if !defined(BOOST_ASIO_NO_EXCEPTIONS)
710 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
711 # define BOOST_ASIO_NO_EXCEPTIONS 1
712 # endif // !defined(BOOST_NO_EXCEPTIONS)
713 #endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
714
715 // Whether the typeid operator is supported.
716 #if !defined(BOOST_ASIO_NO_TYPEID)
717 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
718 # define BOOST_ASIO_NO_TYPEID 1
719 # endif // !defined(BOOST_NO_TYPEID)
720 #endif // !defined(BOOST_ASIO_NO_TYPEID)
721
722 // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
723 // get access to the various platform feature macros, e.g. to be able to test
724 // for threads support.
725 #if !defined(BOOST_ASIO_HAS_UNISTD_H)
726 # if !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
727 # if defined(unix) \
728 || defined(__unix) \
729 || defined(_XOPEN_SOURCE) \
730 || defined(_POSIX_SOURCE) \
731 || (defined(__MACH__) && defined(__APPLE__)) \
732 || defined(__FreeBSD__) \
733 || defined(__NetBSD__) \
734 || defined(__OpenBSD__) \
735 || defined(__linux__)
736 # define BOOST_ASIO_HAS_UNISTD_H 1
737 # endif
738 # endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
739 #endif // !defined(BOOST_ASIO_HAS_UNISTD_H)
740 #if defined(BOOST_ASIO_HAS_UNISTD_H)
741 # include <unistd.h>
742 #endif // defined(BOOST_ASIO_HAS_UNISTD_H)
743
744 // Threads.
745 #if !defined(BOOST_ASIO_HAS_THREADS)
746 # if !defined(BOOST_ASIO_DISABLE_THREADS)
747 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
748 # define BOOST_ASIO_HAS_THREADS 1
749 # elif defined(_MSC_VER) && defined(_MT)
750 # define BOOST_ASIO_HAS_THREADS 1
751 # elif defined(__BORLANDC__) && defined(__MT__)
752 # define BOOST_ASIO_HAS_THREADS 1
753 # elif defined(_POSIX_THREADS)
754 # define BOOST_ASIO_HAS_THREADS 1
755 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
756 # endif // !defined(BOOST_ASIO_DISABLE_THREADS)
757 #endif // !defined(BOOST_ASIO_HAS_THREADS)
758
759 // POSIX threads.
760 #if !defined(BOOST_ASIO_HAS_PTHREADS)
761 # if defined(BOOST_ASIO_HAS_THREADS)
762 # if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
763 # define BOOST_ASIO_HAS_PTHREADS 1
764 # elif defined(_POSIX_THREADS)
765 # define BOOST_ASIO_HAS_PTHREADS 1
766 # endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
767 # endif // defined(BOOST_ASIO_HAS_THREADS)
768 #endif // !defined(BOOST_ASIO_HAS_PTHREADS)
769
770 // Helper to prevent macro expansion.
771 #define BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION
772
773 // Helper to define in-class constants.
774 #if !defined(BOOST_ASIO_STATIC_CONSTANT)
775 # if !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
776 # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
777 BOOST_STATIC_CONSTANT(type, assignment)
778 # else // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
779 # define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
780 static const type assignment
781 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
782 #endif // !defined(BOOST_ASIO_STATIC_CONSTANT)
783
784 // Boost array library.
785 #if !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
786 # if !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
787 # define BOOST_ASIO_HAS_BOOST_ARRAY 1
788 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
789 #endif // !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
790
791 // Boost assert macro.
792 #if !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
793 # if !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
794 # define BOOST_ASIO_HAS_BOOST_ASSERT 1
795 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
796 #endif // !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
797
798 // Boost limits header.
799 #if !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
800 # if !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
801 # define BOOST_ASIO_HAS_BOOST_LIMITS 1
802 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
803 #endif // !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
804
805 // Boost throw_exception function.
806 #if !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
807 # if !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
808 # define BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION 1
809 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
810 #endif // !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
811
812 // Boost regex library.
813 #if !defined(BOOST_ASIO_HAS_BOOST_REGEX)
814 # if !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
815 # define BOOST_ASIO_HAS_BOOST_REGEX 1
816 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
817 #endif // !defined(BOOST_ASIO_HAS_BOOST_REGEX)
818
819 // Boost bind function.
820 #if !defined(BOOST_ASIO_HAS_BOOST_BIND)
821 # if !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
822 # define BOOST_ASIO_HAS_BOOST_BIND 1
823 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
824 #endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
825
826 // Boost's BOOST_WORKAROUND macro.
827 #if !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
828 # if !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
829 # define BOOST_ASIO_HAS_BOOST_WORKAROUND 1
830 # endif // !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
831 #endif // !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
832
833 // Microsoft Visual C++'s secure C runtime library.
834 #if !defined(BOOST_ASIO_HAS_SECURE_RTL)
835 # if !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
836 # if defined(BOOST_ASIO_MSVC) \
837 && (BOOST_ASIO_MSVC >= 1400) \
838 && !defined(UNDER_CE)
839 # define BOOST_ASIO_HAS_SECURE_RTL 1
840 # endif // defined(BOOST_ASIO_MSVC)
841 // && (BOOST_ASIO_MSVC >= 1400)
842 // && !defined(UNDER_CE)
843 # endif // !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
844 #endif // !defined(BOOST_ASIO_HAS_SECURE_RTL)
845
846 // Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
847 #if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
848 # if !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
849 # if defined(__GNUC__)
850 # if (__GNUC__ >= 3)
851 # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
852 # endif // (__GNUC__ >= 3)
853 # elif !defined(__BORLANDC__)
854 # define BOOST_ASIO_HAS_HANDLER_HOOKS 1
855 # endif // !defined(__BORLANDC__)
856 # endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
857 #endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
858
859 // Support for the __thread keyword extension.
860 #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
861 # if defined(__linux__)
862 # if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
863 # if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
864 # if !defined(__INTEL_COMPILER) && !defined(__ICL)
865 # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
866 # define BOOST_ASIO_THREAD_KEYWORD __thread
867 # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
868 # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
869 # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
870 # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
871 # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
872 # endif // defined(__linux__)
873 # if defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
874 # if (_MSC_VER >= 1700)
875 # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
876 # define BOOST_ASIO_THREAD_KEYWORD __declspec(thread)
877 # endif // (_MSC_VER >= 1700)
878 # endif // defined(BOOST_ASIO_MSVC) && defined(BOOST_ASIO_WINDOWS_RUNTIME)
879 #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
880 #if !defined(BOOST_ASIO_THREAD_KEYWORD)
881 # define BOOST_ASIO_THREAD_KEYWORD __thread
882 #endif // !defined(BOOST_ASIO_THREAD_KEYWORD)
883
884 // Support for POSIX ssize_t typedef.
885 #if !defined(BOOST_ASIO_DISABLE_SSIZE_T)
886 # if defined(__linux__) \
887 || (defined(__MACH__) && defined(__APPLE__))
888 # define BOOST_ASIO_HAS_SSIZE_T 1
889 # endif // defined(__linux__)
890 // || (defined(__MACH__) && defined(__APPLE__))
891 #endif // !defined(BOOST_ASIO_DISABLE_SSIZE_T)
892
893 #endif // BOOST_ASIO_DETAIL_CONFIG_HPP