Realistic 3D camera system
3D camera system components
config.hpp
Go to the documentation of this file.
1 //
2 // detail/config.hpp
3 // ~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 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 ASIO_DETAIL_CONFIG_HPP
12 #define ASIO_DETAIL_CONFIG_HPP
13 
14 #if defined(ASIO_STANDALONE)
15 # define ASIO_DISABLE_BOOST_ARRAY 1
16 # define ASIO_DISABLE_BOOST_ASSERT 1
17 # define ASIO_DISABLE_BOOST_BIND 1
18 # define ASIO_DISABLE_BOOST_CHRONO 1
19 # define ASIO_DISABLE_BOOST_DATE_TIME 1
20 # define ASIO_DISABLE_BOOST_LIMITS 1
21 # define ASIO_DISABLE_BOOST_REGEX 1
22 # define ASIO_DISABLE_BOOST_STATIC_CONSTANT 1
23 # define ASIO_DISABLE_BOOST_THROW_EXCEPTION 1
24 # define ASIO_DISABLE_BOOST_WORKAROUND 1
25 #else // defined(ASIO_STANDALONE)
26 # include <boost/config.hpp>
27 # include <boost/version.hpp>
28 # define ASIO_HAS_BOOST_CONFIG 1
29 #endif // defined(ASIO_STANDALONE)
30 
31 // Default to a header-only implementation. The user must specifically request
32 // separate compilation by defining either ASIO_SEPARATE_COMPILATION or
33 // ASIO_DYN_LINK (as a DLL/shared library implies separate compilation).
34 #if !defined(ASIO_HEADER_ONLY)
35 # if !defined(ASIO_SEPARATE_COMPILATION)
36 # if !defined(ASIO_DYN_LINK)
37 # define ASIO_HEADER_ONLY 1
38 # endif // !defined(ASIO_DYN_LINK)
39 # endif // !defined(ASIO_SEPARATE_COMPILATION)
40 #endif // !defined(ASIO_HEADER_ONLY)
41 
42 #if defined(ASIO_HEADER_ONLY)
43 # define ASIO_DECL inline
44 #else // defined(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 ASIO_DYN_LINK.
48 # if defined(ASIO_DYN_LINK)
49 // Export if this is our own source, otherwise import.
50 # if defined(ASIO_SOURCE)
51 # define ASIO_DECL __declspec(dllexport)
52 # else // defined(ASIO_SOURCE)
53 # define ASIO_DECL __declspec(dllimport)
54 # endif // defined(ASIO_SOURCE)
55 # endif // defined(ASIO_DYN_LINK)
56 # endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
57 #endif // defined(ASIO_HEADER_ONLY)
58 
59 // If ASIO_DECL isn't defined yet define it now.
60 #if !defined(ASIO_DECL)
61 # define ASIO_DECL
62 #endif // !defined(ASIO_DECL)
63 
64 // Microsoft Visual C++ detection.
65 #if !defined(ASIO_MSVC)
66 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
67 # define ASIO_MSVC BOOST_MSVC
68 # elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
69 # define ASIO_MSVC _MSC_VER
70 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
71 #endif // defined(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 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(ASIO_HAS_MOVE)
87 # if !defined(ASIO_DISABLE_MOVE)
88 # if defined(__clang__)
89 # if __has_feature(__cxx_rvalue_references__)
90 # define 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 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(ASIO_MSVC)
101 # if (_MSC_VER >= 1700)
102 # define ASIO_HAS_MOVE 1
103 # endif // (_MSC_VER >= 1700)
104 # endif // defined(ASIO_MSVC)
105 # endif // !defined(ASIO_DISABLE_MOVE)
106 #endif // !defined(ASIO_HAS_MOVE)
107 
108 // If ASIO_MOVE_CAST isn't defined, and move support is available, define
109 // ASIO_MOVE_ARG and ASIO_MOVE_CAST to take advantage of rvalue
110 // references and perfect forwarding.
111 #if defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST)
112 # define ASIO_MOVE_ARG(type) type&&
113 # define ASIO_MOVE_CAST(type) static_cast<type&&>
114 # define ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
115 #endif // defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST)
116 
117 // If 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(ASIO_MOVE_CAST)
123 # if defined(__GNUC__)
124 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
125 # define ASIO_MOVE_ARG(type) const type&
126 # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
127 # define ASIO_MOVE_ARG(type) type
128 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
129 # elif defined(ASIO_MSVC)
130 # if (_MSC_VER >= 1400)
131 # define ASIO_MOVE_ARG(type) const type&
132 # else // (_MSC_VER >= 1400)
133 # define ASIO_MOVE_ARG(type) type
134 # endif // (_MSC_VER >= 1400)
135 # else
136 # define ASIO_MOVE_ARG(type) type
137 # endif
138 # define ASIO_MOVE_CAST(type) static_cast<const type&>
139 # define ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
140 #endif // !defined(ASIO_MOVE_CAST)
141 
142 // Support variadic templates on compilers known to allow it.
143 #if !defined(ASIO_HAS_VARIADIC_TEMPLATES)
144 # if !defined(ASIO_DISABLE_VARIADIC_TEMPLATES)
145 # if defined(__clang__)
146 # if __has_feature(__cxx_variadic_templates__)
147 # define 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 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(ASIO_DISABLE_VARIADIC_TEMPLATES)
158 #endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES)
159 
160 // Support constexpr on compilers known to allow it.
161 #if !defined(ASIO_HAS_CONSTEXPR)
162 # if !defined(ASIO_DISABLE_CONSTEXPR)
163 # if defined(__clang__)
164 # if __has_feature(__cxx_constexpr__)
165 # define 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 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(ASIO_DISABLE_CONSTEXPR)
176 #endif // !defined(ASIO_HAS_CONSTEXPR)
177 #if !defined(ASIO_CONSTEXPR)
178 # if defined(ASIO_HAS_CONSTEXPR)
179 # define ASIO_CONSTEXPR constexpr
180 # else // defined(ASIO_HAS_CONSTEXPR)
181 # define ASIO_CONSTEXPR
182 # endif // defined(ASIO_HAS_CONSTEXPR)
183 #endif // !defined(ASIO_CONSTEXPR)
184 
185 // Standard library support for system errors.
186 #if !defined(ASIO_HAS_STD_SYSTEM_ERROR)
187 # if !defined(ASIO_DISABLE_STD_SYSTEM_ERROR)
188 # if defined(__clang__)
189 # if defined(ASIO_HAS_CLANG_LIBCXX)
190 # define ASIO_HAS_STD_SYSTEM_ERROR 1
191 # elif (__cplusplus >= 201103)
192 # if __has_include(<system_error>)
193 # define ASIO_HAS_STD_SYSTEM_ERROR 1
194 # endif // __has_include(<system_error>)
195 # endif // (__cplusplus >= 201103)
196 # endif // defined(__clang__)
197 # if defined(__GNUC__)
198 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
199 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
200 # define ASIO_HAS_STD_SYSTEM_ERROR 1
201 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
202 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
203 # endif // defined(__GNUC__)
204 # if defined(ASIO_MSVC)
205 # if (_MSC_VER >= 1700)
206 # define ASIO_HAS_STD_SYSTEM_ERROR 1
207 # endif // (_MSC_VER >= 1700)
208 # endif // defined(ASIO_MSVC)
209 # endif // !defined(ASIO_DISABLE_STD_SYSTEM_ERROR)
210 #endif // !defined(ASIO_HAS_STD_SYSTEM_ERROR)
211 
212 // Compliant C++11 compilers put noexcept specifiers on error_category members.
213 #if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
214 # if (BOOST_VERSION >= 105300)
215 # define ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
216 # elif defined(__clang__)
217 # if __has_feature(__cxx_noexcept__)
218 # define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
219 # endif // __has_feature(__cxx_noexcept__)
220 # elif defined(__GNUC__)
221 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
222 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
223 # define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
224 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
225 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
226 # endif // defined(__GNUC__)
227 # if defined(ASIO_MSVC)
228 # if (_MSC_VER >= 1900)
229 # define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
230 # endif // (_MSC_VER >= 1900)
231 # endif // defined(ASIO_MSVC)
232 # if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
233 # define ASIO_ERROR_CATEGORY_NOEXCEPT
234 # endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
235 #endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
236 
237 // Standard library support for arrays.
238 #if !defined(ASIO_HAS_STD_ARRAY)
239 # if !defined(ASIO_DISABLE_STD_ARRAY)
240 # if defined(__clang__)
241 # if defined(ASIO_HAS_CLANG_LIBCXX)
242 # define ASIO_HAS_STD_ARRAY 1
243 # elif (__cplusplus >= 201103)
244 # if __has_include(<array>)
245 # define ASIO_HAS_STD_ARRAY 1
246 # endif // __has_include(<array>)
247 # endif // (__cplusplus >= 201103)
248 # endif // defined(__clang__)
249 # if defined(__GNUC__)
250 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
251 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
252 # define ASIO_HAS_STD_ARRAY 1
253 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
254 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
255 # endif // defined(__GNUC__)
256 # if defined(ASIO_MSVC)
257 # if (_MSC_VER >= 1600)
258 # define ASIO_HAS_STD_ARRAY 1
259 # endif // (_MSC_VER >= 1600)
260 # endif // defined(ASIO_MSVC)
261 # endif // !defined(ASIO_DISABLE_STD_ARRAY)
262 #endif // !defined(ASIO_HAS_STD_ARRAY)
263 
264 // Standard library support for shared_ptr and weak_ptr.
265 #if !defined(ASIO_HAS_STD_SHARED_PTR)
266 # if !defined(ASIO_DISABLE_STD_SHARED_PTR)
267 # if defined(__clang__)
268 # if defined(ASIO_HAS_CLANG_LIBCXX)
269 # define ASIO_HAS_STD_SHARED_PTR 1
270 # elif (__cplusplus >= 201103)
271 # define ASIO_HAS_STD_SHARED_PTR 1
272 # endif // (__cplusplus >= 201103)
273 # endif // defined(__clang__)
274 # if defined(__GNUC__)
275 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
276 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
277 # define ASIO_HAS_STD_SHARED_PTR 1
278 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
279 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
280 # endif // defined(__GNUC__)
281 # if defined(ASIO_MSVC)
282 # if (_MSC_VER >= 1600)
283 # define ASIO_HAS_STD_SHARED_PTR 1
284 # endif // (_MSC_VER >= 1600)
285 # endif // defined(ASIO_MSVC)
286 # endif // !defined(ASIO_DISABLE_STD_SHARED_PTR)
287 #endif // !defined(ASIO_HAS_STD_SHARED_PTR)
288 
289 // Standard library support for atomic operations.
290 #if !defined(ASIO_HAS_STD_ATOMIC)
291 # if !defined(ASIO_DISABLE_STD_ATOMIC)
292 # if defined(__clang__)
293 # if defined(ASIO_HAS_CLANG_LIBCXX)
294 # define ASIO_HAS_STD_ATOMIC 1
295 # elif (__cplusplus >= 201103)
296 # if __has_include(<atomic>)
297 # define ASIO_HAS_STD_ATOMIC 1
298 # endif // __has_include(<atomic>)
299 # endif // (__cplusplus >= 201103)
300 # endif // defined(__clang__)
301 # if defined(__GNUC__)
302 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
303 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
304 # define ASIO_HAS_STD_ATOMIC 1
305 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
306 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
307 # endif // defined(__GNUC__)
308 # if defined(ASIO_MSVC)
309 # if (_MSC_VER >= 1700)
310 # define ASIO_HAS_STD_ATOMIC 1
311 # endif // (_MSC_VER >= 1700)
312 # endif // defined(ASIO_MSVC)
313 # endif // !defined(ASIO_DISABLE_STD_ATOMIC)
314 #endif // !defined(ASIO_HAS_STD_ATOMIC)
315 
316 // Standard library support for chrono. Some standard libraries (such as the
317 // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
318 // drafts, rather than the eventually standardised name of steady_clock.
319 #if !defined(ASIO_HAS_STD_CHRONO)
320 # if !defined(ASIO_DISABLE_STD_CHRONO)
321 # if defined(__clang__)
322 # if defined(ASIO_HAS_CLANG_LIBCXX)
323 # define ASIO_HAS_STD_CHRONO 1
324 # elif (__cplusplus >= 201103)
325 # if __has_include(<chrono>)
326 # define ASIO_HAS_STD_CHRONO 1
327 # endif // __has_include(<chrono>)
328 # endif // (__cplusplus >= 201103)
329 # endif // defined(__clang__)
330 # if defined(__GNUC__)
331 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
332 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
333 # define ASIO_HAS_STD_CHRONO 1
334 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
335 # define ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
336 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
337 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
338 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
339 # endif // defined(__GNUC__)
340 # if defined(ASIO_MSVC)
341 # if (_MSC_VER >= 1700)
342 # define ASIO_HAS_STD_CHRONO 1
343 # endif // (_MSC_VER >= 1700)
344 # endif // defined(ASIO_MSVC)
345 # endif // !defined(ASIO_DISABLE_STD_CHRONO)
346 #endif // !defined(ASIO_HAS_STD_CHRONO)
347 
348 // Boost support for chrono.
349 #if !defined(ASIO_HAS_BOOST_CHRONO)
350 # if !defined(ASIO_DISABLE_BOOST_CHRONO)
351 # if (BOOST_VERSION >= 104700)
352 # define ASIO_HAS_BOOST_CHRONO 1
353 # endif // (BOOST_VERSION >= 104700)
354 # endif // !defined(ASIO_DISABLE_BOOST_CHRONO)
355 #endif // !defined(ASIO_HAS_BOOST_CHRONO)
356 
357 // Boost support for the DateTime library.
358 #if !defined(ASIO_HAS_BOOST_DATE_TIME)
359 # if !defined(ASIO_DISABLE_BOOST_DATE_TIME)
360 # define ASIO_HAS_BOOST_DATE_TIME 1
361 # endif // !defined(ASIO_DISABLE_BOOST_DATE_TIME)
362 #endif // !defined(ASIO_HAS_BOOST_DATE_TIME)
363 
364 // Standard library support for addressof.
365 #if !defined(ASIO_HAS_STD_ADDRESSOF)
366 # if !defined(ASIO_DISABLE_STD_ADDRESSOF)
367 # if defined(__clang__)
368 # if defined(ASIO_HAS_CLANG_LIBCXX)
369 # define ASIO_HAS_STD_ADDRESSOF 1
370 # elif (__cplusplus >= 201103)
371 # define ASIO_HAS_STD_ADDRESSOF 1
372 # endif // (__cplusplus >= 201103)
373 # endif // defined(__clang__)
374 # if defined(__GNUC__)
375 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
376 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
377 # define ASIO_HAS_STD_ADDRESSOF 1
378 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
379 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
380 # endif // defined(__GNUC__)
381 # if defined(ASIO_MSVC)
382 # if (_MSC_VER >= 1700)
383 # define ASIO_HAS_STD_ADDRESSOF 1
384 # endif // (_MSC_VER >= 1700)
385 # endif // defined(ASIO_MSVC)
386 # endif // !defined(ASIO_DISABLE_STD_ADDRESSOF)
387 #endif // !defined(ASIO_HAS_STD_ADDRESSOF)
388 
389 // Standard library support for the function class.
390 #if !defined(ASIO_HAS_STD_FUNCTION)
391 # if !defined(ASIO_DISABLE_STD_FUNCTION)
392 # if defined(__clang__)
393 # if defined(ASIO_HAS_CLANG_LIBCXX)
394 # define ASIO_HAS_STD_FUNCTION 1
395 # elif (__cplusplus >= 201103)
396 # define ASIO_HAS_STD_FUNCTION 1
397 # endif // (__cplusplus >= 201103)
398 # endif // defined(__clang__)
399 # if defined(__GNUC__)
400 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
401 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
402 # define ASIO_HAS_STD_FUNCTION 1
403 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
404 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
405 # endif // defined(__GNUC__)
406 # if defined(ASIO_MSVC)
407 # if (_MSC_VER >= 1700)
408 # define ASIO_HAS_STD_FUNCTION 1
409 # endif // (_MSC_VER >= 1700)
410 # endif // defined(ASIO_MSVC)
411 # endif // !defined(ASIO_DISABLE_STD_FUNCTION)
412 #endif // !defined(ASIO_HAS_STD_FUNCTION)
413 
414 // Standard library support for type traits.
415 #if !defined(ASIO_HAS_STD_TYPE_TRAITS)
416 # if !defined(ASIO_DISABLE_STD_TYPE_TRAITS)
417 # if defined(__clang__)
418 # if defined(ASIO_HAS_CLANG_LIBCXX)
419 # define ASIO_HAS_STD_TYPE_TRAITS 1
420 # elif (__cplusplus >= 201103)
421 # if __has_include(<type_traits>)
422 # define ASIO_HAS_STD_TYPE_TRAITS 1
423 # endif // __has_include(<type_traits>)
424 # endif // (__cplusplus >= 201103)
425 # endif // defined(__clang__)
426 # if defined(__GNUC__)
427 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
428 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
429 # define ASIO_HAS_STD_TYPE_TRAITS 1
430 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
431 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
432 # endif // defined(__GNUC__)
433 # if defined(ASIO_MSVC)
434 # if (_MSC_VER >= 1700)
435 # define ASIO_HAS_STD_TYPE_TRAITS 1
436 # endif // (_MSC_VER >= 1700)
437 # endif // defined(ASIO_MSVC)
438 # endif // !defined(ASIO_DISABLE_STD_TYPE_TRAITS)
439 #endif // !defined(ASIO_HAS_STD_TYPE_TRAITS)
440 
441 // Standard library support for the cstdint header.
442 #if !defined(ASIO_HAS_CSTDINT)
443 # if !defined(ASIO_DISABLE_CSTDINT)
444 # if defined(__clang__)
445 # if defined(ASIO_HAS_CLANG_LIBCXX)
446 # define ASIO_HAS_CSTDINT 1
447 # elif (__cplusplus >= 201103)
448 # define ASIO_HAS_CSTDINT 1
449 # endif // (__cplusplus >= 201103)
450 # endif // defined(__clang__)
451 # if defined(__GNUC__)
452 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
453 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
454 # define ASIO_HAS_CSTDINT 1
455 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
456 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
457 # endif // defined(__GNUC__)
458 # if defined(ASIO_MSVC)
459 # if (_MSC_VER >= 1700)
460 # define ASIO_HAS_CSTDINT 1
461 # endif // (_MSC_VER >= 1700)
462 # endif // defined(ASIO_MSVC)
463 # endif // !defined(ASIO_DISABLE_CSTDINT)
464 #endif // !defined(ASIO_HAS_CSTDINT)
465 
466 // Standard library support for the thread class.
467 #if !defined(ASIO_HAS_STD_THREAD)
468 # if !defined(ASIO_DISABLE_STD_THREAD)
469 # if defined(__clang__)
470 # if defined(ASIO_HAS_CLANG_LIBCXX)
471 # define ASIO_HAS_STD_THREAD 1
472 # elif (__cplusplus >= 201103)
473 # if __has_include(<thread>)
474 # define ASIO_HAS_STD_THREAD 1
475 # endif // __has_include(<thread>)
476 # endif // (__cplusplus >= 201103)
477 # endif // defined(__clang__)
478 # if defined(__GNUC__)
479 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
480 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
481 # define ASIO_HAS_STD_THREAD 1
482 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
483 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
484 # endif // defined(__GNUC__)
485 # if defined(ASIO_MSVC)
486 # if (_MSC_VER >= 1700)
487 # define ASIO_HAS_STD_THREAD 1
488 # endif // (_MSC_VER >= 1700)
489 # endif // defined(ASIO_MSVC)
490 # endif // !defined(ASIO_DISABLE_STD_THREAD)
491 #endif // !defined(ASIO_HAS_STD_THREAD)
492 
493 // Standard library support for the mutex and condition variable classes.
494 #if !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
495 # if !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
496 # if defined(__clang__)
497 # if defined(ASIO_HAS_CLANG_LIBCXX)
498 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
499 # elif (__cplusplus >= 201103)
500 # if __has_include(<mutex>)
501 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
502 # endif // __has_include(<mutex>)
503 # endif // (__cplusplus >= 201103)
504 # endif // defined(__clang__)
505 # if defined(__GNUC__)
506 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
507 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
508 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
509 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
510 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
511 # endif // defined(__GNUC__)
512 # if defined(ASIO_MSVC)
513 # if (_MSC_VER >= 1700)
514 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1
515 # endif // (_MSC_VER >= 1700)
516 # endif // defined(ASIO_MSVC)
517 # endif // !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR)
518 #endif // !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR)
519 
520 // WinRT target.
521 #if !defined(ASIO_WINDOWS_RUNTIME)
522 # if defined(__cplusplus_winrt)
523 # include <winapifamily.h>
524 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \
525  && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
526 # define ASIO_WINDOWS_RUNTIME 1
527 # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
528  // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
529 # endif // defined(__cplusplus_winrt)
530 #endif // !defined(ASIO_WINDOWS_RUNTIME)
531 
532 // Windows target. Excludes WinRT.
533 #if !defined(ASIO_WINDOWS)
534 # if !defined(ASIO_WINDOWS_RUNTIME)
535 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
536 # define ASIO_WINDOWS 1
537 # elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
538 # define ASIO_WINDOWS 1
539 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
540 # endif // !defined(ASIO_WINDOWS_RUNTIME)
541 #endif // !defined(ASIO_WINDOWS)
542 
543 // Windows: target OS version.
544 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
545 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
546 # if defined(_MSC_VER) || defined(__BORLANDC__)
547 # pragma message( \
548  "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\
549  "- add -D_WIN32_WINNT=0x0501 to the compiler command line; or\n"\
550  "- add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.\n"\
551  "Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).")
552 # else // defined(_MSC_VER) || defined(__BORLANDC__)
553 # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
554 # warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line.
555 # warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).
556 # endif // defined(_MSC_VER) || defined(__BORLANDC__)
557 # define _WIN32_WINNT 0x0501
558 # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
559 # if defined(_MSC_VER)
560 # if defined(_WIN32) && !defined(WIN32)
561 # if !defined(_WINSOCK2API_)
562 # define WIN32 // Needed for correct types in winsock2.h
563 # else // !defined(_WINSOCK2API_)
564 # error Please define the macro WIN32 in your compiler options
565 # endif // !defined(_WINSOCK2API_)
566 # endif // defined(_WIN32) && !defined(WIN32)
567 # endif // defined(_MSC_VER)
568 # if defined(__BORLANDC__)
569 # if defined(__WIN32__) && !defined(WIN32)
570 # if !defined(_WINSOCK2API_)
571 # define WIN32 // Needed for correct types in winsock2.h
572 # else // !defined(_WINSOCK2API_)
573 # error Please define the macro WIN32 in your compiler options
574 # endif // !defined(_WINSOCK2API_)
575 # endif // defined(__WIN32__) && !defined(WIN32)
576 # endif // defined(__BORLANDC__)
577 # if defined(__CYGWIN__)
578 # if !defined(__USE_W32_SOCKETS)
579 # error You must add -D__USE_W32_SOCKETS to your compiler options.
580 # endif // !defined(__USE_W32_SOCKETS)
581 # endif // defined(__CYGWIN__)
582 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
583 
584 // Windows: minimise header inclusion.
585 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
586 # if !defined(ASIO_NO_WIN32_LEAN_AND_MEAN)
587 # if !defined(WIN32_LEAN_AND_MEAN)
588 # define WIN32_LEAN_AND_MEAN
589 # endif // !defined(WIN32_LEAN_AND_MEAN)
590 # endif // !defined(ASIO_NO_WIN32_LEAN_AND_MEAN)
591 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
592 
593 // Windows: suppress definition of "min" and "max" macros.
594 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
595 # if !defined(ASIO_NO_NOMINMAX)
596 # if !defined(NOMINMAX)
597 # define NOMINMAX 1
598 # endif // !defined(NOMINMAX)
599 # endif // !defined(ASIO_NO_NOMINMAX)
600 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
601 
602 // Windows: IO Completion Ports.
603 #if !defined(ASIO_HAS_IOCP)
604 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
605 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
606 # if !defined(UNDER_CE)
607 # if !defined(ASIO_DISABLE_IOCP)
608 # define ASIO_HAS_IOCP 1
609 # endif // !defined(ASIO_DISABLE_IOCP)
610 # endif // !defined(UNDER_CE)
611 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
612 # endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
613 #endif // !defined(ASIO_HAS_IOCP)
614 
615 // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
616 // get access to the various platform feature macros, e.g. to be able to test
617 // for threads support.
618 #if !defined(ASIO_HAS_UNISTD_H)
619 # if !defined(ASIO_HAS_BOOST_CONFIG)
620 # if defined(unix) \
621  || defined(__unix) \
622  || defined(_XOPEN_SOURCE) \
623  || defined(_POSIX_SOURCE) \
624  || (defined(__MACH__) && defined(__APPLE__)) \
625  || defined(__FreeBSD__) \
626  || defined(__NetBSD__) \
627  || defined(__OpenBSD__) \
628  || defined(__linux__)
629 # define ASIO_HAS_UNISTD_H 1
630 # endif
631 # endif // !defined(ASIO_HAS_BOOST_CONFIG)
632 #endif // !defined(ASIO_HAS_UNISTD_H)
633 #if defined(ASIO_HAS_UNISTD_H)
634 # include <unistd.h>
635 #endif // defined(ASIO_HAS_UNISTD_H)
636 
637 // Linux: epoll, eventfd and timerfd.
638 #if defined(__linux__)
639 # include <linux/version.h>
640 # if !defined(ASIO_HAS_EPOLL)
641 # if !defined(ASIO_DISABLE_EPOLL)
642 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
643 # define ASIO_HAS_EPOLL 1
644 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
645 # endif // !defined(ASIO_DISABLE_EPOLL)
646 # endif // !defined(ASIO_HAS_EPOLL)
647 # if !defined(ASIO_HAS_EVENTFD)
648 # if !defined(ASIO_DISABLE_EVENTFD)
649 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
650 # define ASIO_HAS_EVENTFD 1
651 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
652 # endif // !defined(ASIO_DISABLE_EVENTFD)
653 # endif // !defined(ASIO_HAS_EVENTFD)
654 # if !defined(ASIO_HAS_TIMERFD)
655 # if defined(ASIO_HAS_EPOLL)
656 # if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
657 # define ASIO_HAS_TIMERFD 1
658 # endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
659 # endif // defined(ASIO_HAS_EPOLL)
660 # endif // !defined(ASIO_HAS_TIMERFD)
661 #endif // defined(__linux__)
662 
663 // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
664 #if (defined(__MACH__) && defined(__APPLE__)) \
665  || defined(__FreeBSD__) \
666  || defined(__NetBSD__) \
667  || defined(__OpenBSD__)
668 # if !defined(ASIO_HAS_KQUEUE)
669 # if !defined(ASIO_DISABLE_KQUEUE)
670 # define ASIO_HAS_KQUEUE 1
671 # endif // !defined(ASIO_DISABLE_KQUEUE)
672 # endif // !defined(ASIO_HAS_KQUEUE)
673 #endif // (defined(__MACH__) && defined(__APPLE__))
674  // || defined(__FreeBSD__)
675  // || defined(__NetBSD__)
676  // || defined(__OpenBSD__)
677 
678 // Solaris: /dev/poll.
679 #if defined(__sun)
680 # if !defined(ASIO_HAS_DEV_POLL)
681 # if !defined(ASIO_DISABLE_DEV_POLL)
682 # define ASIO_HAS_DEV_POLL 1
683 # endif // !defined(ASIO_DISABLE_DEV_POLL)
684 # endif // !defined(ASIO_HAS_DEV_POLL)
685 #endif // defined(__sun)
686 
687 // Serial ports.
688 #if !defined(ASIO_HAS_SERIAL_PORT)
689 # if defined(ASIO_HAS_IOCP) \
690  || !defined(ASIO_WINDOWS) \
691  && !defined(ASIO_WINDOWS_RUNTIME) \
692  && !defined(__CYGWIN__)
693 # if !defined(__SYMBIAN32__)
694 # if !defined(ASIO_DISABLE_SERIAL_PORT)
695 # define ASIO_HAS_SERIAL_PORT 1
696 # endif // !defined(ASIO_DISABLE_SERIAL_PORT)
697 # endif // !defined(__SYMBIAN32__)
698 # endif // defined(ASIO_HAS_IOCP)
699  // || !defined(ASIO_WINDOWS)
700  // && !defined(ASIO_WINDOWS_RUNTIME)
701  // && !defined(__CYGWIN__)
702 #endif // !defined(ASIO_HAS_SERIAL_PORT)
703 
704 // Windows: stream handles.
705 #if !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE)
706 # if !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
707 # if defined(ASIO_HAS_IOCP)
708 # define ASIO_HAS_WINDOWS_STREAM_HANDLE 1
709 # endif // defined(ASIO_HAS_IOCP)
710 # endif // !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
711 #endif // !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE)
712 
713 // Windows: random access handles.
714 #if !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
715 # if !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
716 # if defined(ASIO_HAS_IOCP)
717 # define ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
718 # endif // defined(ASIO_HAS_IOCP)
719 # endif // !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
720 #endif // !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
721 
722 // Windows: object handles.
723 #if !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE)
724 # if !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
725 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
726 # if !defined(UNDER_CE)
727 # define ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
728 # endif // !defined(UNDER_CE)
729 # endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__)
730 # endif // !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
731 #endif // !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE)
732 
733 // Windows: OVERLAPPED wrapper.
734 #if !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
735 # if !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
736 # if defined(ASIO_HAS_IOCP)
737 # define ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
738 # endif // defined(ASIO_HAS_IOCP)
739 # endif // !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
740 #endif // !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
741 
742 // POSIX: stream-oriented file descriptors.
743 #if !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
744 # if !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
745 # if !defined(ASIO_WINDOWS) \
746  && !defined(ASIO_WINDOWS_RUNTIME) \
747  && !defined(__CYGWIN__)
748 # define ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
749 # endif // !defined(ASIO_WINDOWS)
750  // && !defined(ASIO_WINDOWS_RUNTIME)
751  // && !defined(__CYGWIN__)
752 # endif // !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
753 #endif // !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
754 
755 // UNIX domain sockets.
756 #if !defined(ASIO_HAS_LOCAL_SOCKETS)
757 # if !defined(ASIO_DISABLE_LOCAL_SOCKETS)
758 # if !defined(ASIO_WINDOWS) \
759  && !defined(ASIO_WINDOWS_RUNTIME) \
760  && !defined(__CYGWIN__)
761 # define ASIO_HAS_LOCAL_SOCKETS 1
762 # endif // !defined(ASIO_WINDOWS)
763  // && !defined(ASIO_WINDOWS_RUNTIME)
764  // && !defined(__CYGWIN__)
765 # endif // !defined(ASIO_DISABLE_LOCAL_SOCKETS)
766 #endif // !defined(ASIO_HAS_LOCAL_SOCKETS)
767 
768 // Can use sigaction() instead of signal().
769 #if !defined(ASIO_HAS_SIGACTION)
770 # if !defined(ASIO_DISABLE_SIGACTION)
771 # if !defined(ASIO_WINDOWS) \
772  && !defined(ASIO_WINDOWS_RUNTIME) \
773  && !defined(__CYGWIN__)
774 # define ASIO_HAS_SIGACTION 1
775 # endif // !defined(ASIO_WINDOWS)
776  // && !defined(ASIO_WINDOWS_RUNTIME)
777  // && !defined(__CYGWIN__)
778 # endif // !defined(ASIO_DISABLE_SIGACTION)
779 #endif // !defined(ASIO_HAS_SIGACTION)
780 
781 // Can use signal().
782 #if !defined(ASIO_HAS_SIGNAL)
783 # if !defined(ASIO_DISABLE_SIGNAL)
784 # if !defined(UNDER_CE)
785 # define ASIO_HAS_SIGNAL 1
786 # endif // !defined(UNDER_CE)
787 # endif // !defined(ASIO_DISABLE_SIGNAL)
788 #endif // !defined(ASIO_HAS_SIGNAL)
789 
790 // Can use getaddrinfo() and getnameinfo().
791 #if !defined(ASIO_HAS_GETADDRINFO)
792 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__)
793 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
794 # define ASIO_HAS_GETADDRINFO 1
795 # elif defined(UNDER_CE)
796 # define ASIO_HAS_GETADDRINFO 1
797 # endif // defined(UNDER_CE)
798 # elif !(defined(__MACH__) && defined(__APPLE__))
799 # define ASIO_HAS_GETADDRINFO 1
800 # endif // !(defined(__MACH__) && defined(__APPLE__))
801 #endif // !defined(ASIO_HAS_GETADDRINFO)
802 
803 // Whether standard iostreams are disabled.
804 #if !defined(ASIO_NO_IOSTREAM)
805 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
806 # define ASIO_NO_IOSTREAM 1
807 # endif // !defined(BOOST_NO_IOSTREAM)
808 #endif // !defined(ASIO_NO_IOSTREAM)
809 
810 // Whether exception handling is disabled.
811 #if !defined(ASIO_NO_EXCEPTIONS)
812 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
813 # define ASIO_NO_EXCEPTIONS 1
814 # endif // !defined(BOOST_NO_EXCEPTIONS)
815 #endif // !defined(ASIO_NO_EXCEPTIONS)
816 
817 // Whether the typeid operator is supported.
818 #if !defined(ASIO_NO_TYPEID)
819 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
820 # define ASIO_NO_TYPEID 1
821 # endif // !defined(BOOST_NO_TYPEID)
822 #endif // !defined(ASIO_NO_TYPEID)
823 
824 // Threads.
825 #if !defined(ASIO_HAS_THREADS)
826 # if !defined(ASIO_DISABLE_THREADS)
827 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
828 # define ASIO_HAS_THREADS 1
829 # elif defined(_MSC_VER) && defined(_MT)
830 # define ASIO_HAS_THREADS 1
831 # elif defined(__BORLANDC__) && defined(__MT__)
832 # define ASIO_HAS_THREADS 1
833 # elif defined(_POSIX_THREADS)
834 # define ASIO_HAS_THREADS 1
835 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
836 # endif // !defined(ASIO_DISABLE_THREADS)
837 #endif // !defined(ASIO_HAS_THREADS)
838 
839 // POSIX threads.
840 #if !defined(ASIO_HAS_PTHREADS)
841 # if defined(ASIO_HAS_THREADS)
842 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
843 # define ASIO_HAS_PTHREADS 1
844 # elif defined(_POSIX_THREADS)
845 # define ASIO_HAS_PTHREADS 1
846 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
847 # endif // defined(ASIO_HAS_THREADS)
848 #endif // !defined(ASIO_HAS_PTHREADS)
849 
850 // Helper to prevent macro expansion.
851 #define ASIO_PREVENT_MACRO_SUBSTITUTION
852 
853 // Helper to define in-class constants.
854 #if !defined(ASIO_STATIC_CONSTANT)
855 # if !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT)
856 # define ASIO_STATIC_CONSTANT(type, assignment) \
857  BOOST_STATIC_CONSTANT(type, assignment)
858 # else // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT)
859 # define ASIO_STATIC_CONSTANT(type, assignment) \
860  static const type assignment
861 # endif // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT)
862 #endif // !defined(ASIO_STATIC_CONSTANT)
863 
864 // Boost array library.
865 #if !defined(ASIO_HAS_BOOST_ARRAY)
866 # if !defined(ASIO_DISABLE_BOOST_ARRAY)
867 # define ASIO_HAS_BOOST_ARRAY 1
868 # endif // !defined(ASIO_DISABLE_BOOST_ARRAY)
869 #endif // !defined(ASIO_HAS_BOOST_ARRAY)
870 
871 // Boost assert macro.
872 #if !defined(ASIO_HAS_BOOST_ASSERT)
873 # if !defined(ASIO_DISABLE_BOOST_ASSERT)
874 # define ASIO_HAS_BOOST_ASSERT 1
875 # endif // !defined(ASIO_DISABLE_BOOST_ASSERT)
876 #endif // !defined(ASIO_HAS_BOOST_ASSERT)
877 
878 // Boost limits header.
879 #if !defined(ASIO_HAS_BOOST_LIMITS)
880 # if !defined(ASIO_DISABLE_BOOST_LIMITS)
881 # define ASIO_HAS_BOOST_LIMITS 1
882 # endif // !defined(ASIO_DISABLE_BOOST_LIMITS)
883 #endif // !defined(ASIO_HAS_BOOST_LIMITS)
884 
885 // Boost throw_exception function.
886 #if !defined(ASIO_HAS_BOOST_THROW_EXCEPTION)
887 # if !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION)
888 # define ASIO_HAS_BOOST_THROW_EXCEPTION 1
889 # endif // !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION)
890 #endif // !defined(ASIO_HAS_BOOST_THROW_EXCEPTION)
891 
892 // Boost regex library.
893 #if !defined(ASIO_HAS_BOOST_REGEX)
894 # if !defined(ASIO_DISABLE_BOOST_REGEX)
895 # define ASIO_HAS_BOOST_REGEX 1
896 # endif // !defined(ASIO_DISABLE_BOOST_REGEX)
897 #endif // !defined(ASIO_HAS_BOOST_REGEX)
898 
899 // Boost bind function.
900 #if !defined(ASIO_HAS_BOOST_BIND)
901 # if !defined(ASIO_DISABLE_BOOST_BIND)
902 # define ASIO_HAS_BOOST_BIND 1
903 # endif // !defined(ASIO_DISABLE_BOOST_BIND)
904 #endif // !defined(ASIO_HAS_BOOST_BIND)
905 
906 // Boost's BOOST_WORKAROUND macro.
907 #if !defined(ASIO_HAS_BOOST_WORKAROUND)
908 # if !defined(ASIO_DISABLE_BOOST_WORKAROUND)
909 # define ASIO_HAS_BOOST_WORKAROUND 1
910 # endif // !defined(ASIO_DISABLE_BOOST_WORKAROUND)
911 #endif // !defined(ASIO_HAS_BOOST_WORKAROUND)
912 
913 // Microsoft Visual C++'s secure C runtime library.
914 #if !defined(ASIO_HAS_SECURE_RTL)
915 # if !defined(ASIO_DISABLE_SECURE_RTL)
916 # if defined(ASIO_MSVC) \
917  && (ASIO_MSVC >= 1400) \
918  && !defined(UNDER_CE)
919 # define ASIO_HAS_SECURE_RTL 1
920 # endif // defined(ASIO_MSVC)
921  // && (ASIO_MSVC >= 1400)
922  // && !defined(UNDER_CE)
923 # endif // !defined(ASIO_DISABLE_SECURE_RTL)
924 #endif // !defined(ASIO_HAS_SECURE_RTL)
925 
926 // Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
927 #if !defined(ASIO_HAS_HANDLER_HOOKS)
928 # if !defined(ASIO_DISABLE_HANDLER_HOOKS)
929 # if defined(__GNUC__)
930 # if (__GNUC__ >= 3)
931 # define ASIO_HAS_HANDLER_HOOKS 1
932 # endif // (__GNUC__ >= 3)
933 # elif !defined(__BORLANDC__)
934 # define ASIO_HAS_HANDLER_HOOKS 1
935 # endif // !defined(__BORLANDC__)
936 # endif // !defined(ASIO_DISABLE_HANDLER_HOOKS)
937 #endif // !defined(ASIO_HAS_HANDLER_HOOKS)
938 
939 // Support for the __thread keyword extension.
940 #if !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
941 # if defined(__linux__)
942 # if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
943 # if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
944 # if !defined(__INTEL_COMPILER) && !defined(__ICL)
945 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
946 # define ASIO_THREAD_KEYWORD __thread
947 # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
948 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
949 # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
950 # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
951 # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
952 # endif // defined(__linux__)
953 # if defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME)
954 # if (_MSC_VER >= 1700)
955 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
956 # define ASIO_THREAD_KEYWORD __declspec(thread)
957 # endif // (_MSC_VER >= 1700)
958 # endif // defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME)
959 #endif // !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
960 #if !defined(ASIO_THREAD_KEYWORD)
961 # define ASIO_THREAD_KEYWORD __thread
962 #endif // !defined(ASIO_THREAD_KEYWORD)
963 
964 // Support for POSIX ssize_t typedef.
965 #if !defined(ASIO_DISABLE_SSIZE_T)
966 # if defined(__linux__) \
967  || (defined(__MACH__) && defined(__APPLE__))
968 # define ASIO_HAS_SSIZE_T 1
969 # endif // defined(__linux__)
970  // || (defined(__MACH__) && defined(__APPLE__))
971 #endif // !defined(ASIO_DISABLE_SSIZE_T)
972 
973 #endif // ASIO_DETAIL_CONFIG_HPP