1 // 2 // detail/config.hpp 3 // ~~~~~~~~~~~~~~~~~ 4 // 5 // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 // 7 // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 // 10 11 #ifndef ASIO_DETAIL_CONFIG_HPP 12 #define ASIO_DETAIL_CONFIG_HPP 13 14 // MongoDB modification. We want this standalone, and we want separate 15 // compilation for what we can to cut down on compile times. 16 // We cannot set these outside of the ASIO drop, because a system copy of ASIO might not have been 17 // built with ASIO_SEPARATE_COMPILATION. 18 // TODO: Remove this once we have a mechanism for injecting third party includes and CPPDEFINES into 19 // individual scons objects. 20 # define ASIO_STANDALONE // MongoDB 21 # define ASIO_SEPARATE_COMPILATION // MongoDB 22 23 #if defined(ASIO_STANDALONE) 24 # define ASIO_DISABLE_BOOST_ARRAY 1 25 # define ASIO_DISABLE_BOOST_ASSERT 1 26 # define ASIO_DISABLE_BOOST_BIND 1 27 # define ASIO_DISABLE_BOOST_CHRONO 1 28 # define ASIO_DISABLE_BOOST_DATE_TIME 1 29 # define ASIO_DISABLE_BOOST_LIMITS 1 30 # define ASIO_DISABLE_BOOST_REGEX 1 31 # define ASIO_DISABLE_BOOST_STATIC_CONSTANT 1 32 # define ASIO_DISABLE_BOOST_THROW_EXCEPTION 1 33 # define ASIO_DISABLE_BOOST_WORKAROUND 1 34 #else // defined(ASIO_STANDALONE) 35 # include <boost/config.hpp> 36 # include <boost/version.hpp> 37 # define ASIO_HAS_BOOST_CONFIG 1 38 #endif // defined(ASIO_STANDALONE) 39 40 // Default to a header-only implementation. The user must specifically request 41 // separate compilation by defining either ASIO_SEPARATE_COMPILATION or 42 // ASIO_DYN_LINK (as a DLL/shared library implies separate compilation). 43 #if !defined(ASIO_HEADER_ONLY) 44 # if !defined(ASIO_SEPARATE_COMPILATION) 45 # if !defined(ASIO_DYN_LINK) 46 # define ASIO_HEADER_ONLY 1 47 # endif // !defined(ASIO_DYN_LINK) 48 # endif // !defined(ASIO_SEPARATE_COMPILATION) 49 #endif // !defined(ASIO_HEADER_ONLY) 50 51 #if defined(ASIO_HEADER_ONLY) 52 # define ASIO_DECL inline 53 #else // defined(ASIO_HEADER_ONLY) 54 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__) 55 // We need to import/export our code only if the user has specifically asked 56 // for it by defining ASIO_DYN_LINK. 57 # if defined(ASIO_DYN_LINK) 58 // Export if this is our own source, otherwise import. 59 # if defined(ASIO_SOURCE) 60 # define ASIO_DECL __declspec(dllexport) 61 # else // defined(ASIO_SOURCE) 62 # define ASIO_DECL __declspec(dllimport) 63 # endif // defined(ASIO_SOURCE) 64 # endif // defined(ASIO_DYN_LINK) 65 # endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__) 66 #endif // defined(ASIO_HEADER_ONLY) 67 68 // If ASIO_DECL isn't defined yet define it now. 69 #if !defined(ASIO_DECL) 70 # define ASIO_DECL 71 #endif // !defined(ASIO_DECL) 72 73 // Microsoft Visual C++ detection. 74 #if !defined(ASIO_MSVC) 75 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC) 76 # define ASIO_MSVC BOOST_MSVC 77 # elif defined(_MSC_VER) && (defined(__INTELLISENSE__) \ 78 || (!defined(__MWERKS__) && !defined(__EDG_VERSION__))) 79 # define ASIO_MSVC _MSC_VER 80 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC) 81 #endif // defined(ASIO_MSVC) 82 83 // Clang / libc++ detection. 84 #if defined(__clang__) 85 # if (__cplusplus >= 201103) 86 # if __has_include(<__config>) 87 # include <__config> 88 # if defined(_LIBCPP_VERSION) 89 # define ASIO_HAS_CLANG_LIBCXX 1 90 # endif // defined(_LIBCPP_VERSION) 91 # endif // __has_include(<__config>) 92 # endif // (__cplusplus >= 201103) 93 #endif // defined(__clang__) 94 95 // Android platform detection. 96 #if defined(__ANDROID__) 97 # include <android/api-level.h> 98 #endif // defined(__ANDROID__) 99 100 // Support move construction and assignment on compilers known to allow it. 101 #if !defined(ASIO_HAS_MOVE) 102 # if !defined(ASIO_DISABLE_MOVE) 103 # if defined(__clang__) 104 # if __has_feature(__cxx_rvalue_references__) 105 # define ASIO_HAS_MOVE 1 106 # endif // __has_feature(__cxx_rvalue_references__) 107 # endif // defined(__clang__) 108 # if defined(__GNUC__) 109 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 110 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 111 # define ASIO_HAS_MOVE 1 112 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 113 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 114 # endif // defined(__GNUC__) 115 # if defined(ASIO_MSVC) 116 # if (_MSC_VER >= 1700) 117 # define ASIO_HAS_MOVE 1 118 # endif // (_MSC_VER >= 1700) 119 # endif // defined(ASIO_MSVC) 120 # endif // !defined(ASIO_DISABLE_MOVE) 121 #endif // !defined(ASIO_HAS_MOVE) 122 123 // If ASIO_MOVE_CAST isn't defined, and move support is available, define 124 // ASIO_MOVE_ARG and ASIO_MOVE_CAST to take advantage of rvalue 125 // references and perfect forwarding. 126 #if defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST) 127 # define ASIO_MOVE_ARG(type) type&& 128 # define ASIO_MOVE_ARG2(type1, type2) type1, type2&& 129 # define ASIO_MOVE_CAST(type) static_cast<type&&> 130 # define ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&> 131 #endif // defined(ASIO_HAS_MOVE) && !defined(ASIO_MOVE_CAST) 132 133 // If ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible 134 // implementation. Note that older g++ and MSVC versions don't like it when you 135 // pass a non-member function through a const reference, so for most compilers 136 // we'll play it safe and stick with the old approach of passing the handler by 137 // value. 138 #if !defined(ASIO_MOVE_CAST) 139 # if defined(__GNUC__) 140 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) 141 # define ASIO_MOVE_ARG(type) const type& 142 # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) 143 # define ASIO_MOVE_ARG(type) type 144 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4) 145 # elif defined(ASIO_MSVC) 146 # if (_MSC_VER >= 1400) 147 # define ASIO_MOVE_ARG(type) const type& 148 # else // (_MSC_VER >= 1400) 149 # define ASIO_MOVE_ARG(type) type 150 # endif // (_MSC_VER >= 1400) 151 # else 152 # define ASIO_MOVE_ARG(type) type 153 # endif 154 # define ASIO_MOVE_CAST(type) static_cast<const type&> 155 # define ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&> 156 #endif // !defined(ASIO_MOVE_CAST) 157 158 // Support variadic templates on compilers known to allow it. 159 #if !defined(ASIO_HAS_VARIADIC_TEMPLATES) 160 # if !defined(ASIO_DISABLE_VARIADIC_TEMPLATES) 161 # if defined(__clang__) 162 # if __has_feature(__cxx_variadic_templates__) 163 # define ASIO_HAS_VARIADIC_TEMPLATES 1 164 # endif // __has_feature(__cxx_variadic_templates__) 165 # endif // defined(__clang__) 166 # if defined(__GNUC__) 167 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 168 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 169 # define ASIO_HAS_VARIADIC_TEMPLATES 1 170 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 171 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 172 # endif // defined(__GNUC__) 173 # if defined(ASIO_MSVC) 174 # if (_MSC_VER >= 1900) 175 # define ASIO_HAS_VARIADIC_TEMPLATES 1 176 # endif // (_MSC_VER >= 1900) 177 # endif // defined(ASIO_MSVC) 178 # endif // !defined(ASIO_DISABLE_VARIADIC_TEMPLATES) 179 #endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES) 180 181 // Support deleted functions on compilers known to allow it. 182 #if !defined(ASIO_DELETED) 183 # if defined(__GNUC__) 184 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 185 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 186 # define ASIO_DELETED = delete 187 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 188 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 189 # endif // defined(__GNUC__) 190 # if defined(__clang__) 191 # if __has_feature(__cxx_deleted_functions__) 192 # define ASIO_DELETED = delete 193 # endif // __has_feature(__cxx_deleted_functions__) 194 # endif // defined(__clang__) 195 # if defined(ASIO_MSVC) 196 # if (_MSC_VER >= 1900) 197 # define ASIO_DELETED = delete 198 # endif // (_MSC_VER >= 1900) 199 # endif // defined(ASIO_MSVC) 200 # if !defined(ASIO_DELETED) 201 # define ASIO_DELETED 202 # endif // !defined(ASIO_DELETED) 203 #endif // !defined(ASIO_DELETED) 204 205 // Support constexpr on compilers known to allow it. 206 #if !defined(ASIO_HAS_CONSTEXPR) 207 # if !defined(ASIO_DISABLE_CONSTEXPR) 208 # if defined(__clang__) 209 # if __has_feature(__cxx_constexpr__) 210 # define ASIO_HAS_CONSTEXPR 1 211 # endif // __has_feature(__cxx_constexr__) 212 # endif // defined(__clang__) 213 # if defined(__GNUC__) 214 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 215 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 216 # define ASIO_HAS_CONSTEXPR 1 217 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 218 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 219 # endif // defined(__GNUC__) 220 # if defined(ASIO_MSVC) 221 # if (_MSC_VER >= 1900) 222 # define ASIO_HAS_CONSTEXPR 1 223 # endif // (_MSC_VER >= 1900) 224 # endif // defined(ASIO_MSVC) 225 # endif // !defined(ASIO_DISABLE_CONSTEXPR) 226 #endif // !defined(ASIO_HAS_CONSTEXPR) 227 #if !defined(ASIO_CONSTEXPR) 228 # if defined(ASIO_HAS_CONSTEXPR) 229 # define ASIO_CONSTEXPR constexpr 230 # else // defined(ASIO_HAS_CONSTEXPR) 231 # define ASIO_CONSTEXPR 232 # endif // defined(ASIO_HAS_CONSTEXPR) 233 #endif // !defined(ASIO_CONSTEXPR) 234 235 // Support noexcept on compilers known to allow it. 236 #if !defined(ASIO_NOEXCEPT) 237 # if !defined(ASIO_DISABLE_NOEXCEPT) 238 # if (BOOST_VERSION >= 105300) 239 # define ASIO_NOEXCEPT BOOST_NOEXCEPT 240 # define ASIO_NOEXCEPT_OR_NOTHROW BOOST_NOEXCEPT_OR_NOTHROW 241 # elif defined(__clang__) 242 # if __has_feature(__cxx_noexcept__) 243 # define ASIO_NOEXCEPT noexcept(true) 244 # define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true) 245 # endif // __has_feature(__cxx_noexcept__) 246 # elif defined(__GNUC__) 247 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 248 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 249 # define ASIO_NOEXCEPT noexcept(true) 250 # define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true) 251 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 252 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 253 # elif defined(ASIO_MSVC) 254 # if (_MSC_VER >= 1900) 255 # define ASIO_NOEXCEPT noexcept(true) 256 # define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true) 257 # endif // (_MSC_VER >= 1900) 258 # endif // defined(ASIO_MSVC) 259 # endif // !defined(ASIO_DISABLE_NOEXCEPT) 260 # if !defined(ASIO_NOEXCEPT) 261 # define ASIO_NOEXCEPT 262 # endif // !defined(ASIO_NOEXCEPT) 263 # if !defined(ASIO_NOEXCEPT_OR_NOTHROW) 264 # define ASIO_NOEXCEPT_OR_NOTHROW throw() 265 # endif // !defined(ASIO_NOEXCEPT_OR_NOTHROW) 266 #endif // !defined(ASIO_NOEXCEPT) 267 268 // Support automatic type deduction on compilers known to support it. 269 #if !defined(ASIO_HAS_DECLTYPE) 270 # if !defined(ASIO_DISABLE_DECLTYPE) 271 # if defined(__clang__) 272 # if __has_feature(__cxx_decltype__) 273 # define ASIO_HAS_DECLTYPE 1 274 # endif // __has_feature(__cxx_decltype__) 275 # endif // defined(__clang__) 276 # if defined(__GNUC__) 277 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 278 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 279 # define ASIO_HAS_DECLTYPE 1 280 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 281 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 282 # endif // defined(__GNUC__) 283 # if defined(ASIO_MSVC) 284 # if (_MSC_VER >= 1700) 285 # define ASIO_HAS_DECLTYPE 1 286 # endif // (_MSC_VER >= 1700) 287 # endif // defined(ASIO_MSVC) 288 # endif // !defined(ASIO_DISABLE_DECLTYPE) 289 #endif // !defined(ASIO_HAS_DECLTYPE) 290 291 // Support alias templates on compilers known to allow it. 292 #if !defined(ASIO_HAS_ALIAS_TEMPLATES) 293 # if !defined(ASIO_DISABLE_ALIAS_TEMPLATES) 294 # if defined(__clang__) 295 # if __has_feature(__cxx_alias_templates__) 296 # define ASIO_HAS_ALIAS_TEMPLATES 1 297 # endif // __has_feature(__cxx_alias_templates__) 298 # endif // defined(__clang__) 299 # if defined(__GNUC__) 300 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 301 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 302 # define ASIO_HAS_ALIAS_TEMPLATES 1 303 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 304 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 305 # endif // defined(__GNUC__) 306 # if defined(ASIO_MSVC) 307 # if (_MSC_VER >= 1900) 308 # define ASIO_HAS_ALIAS_TEMPLATES 1 309 # endif // (_MSC_VER >= 1900) 310 # endif // defined(ASIO_MSVC) 311 # endif // !defined(ASIO_DISABLE_ALIAS_TEMPLATES) 312 #endif // !defined(ASIO_HAS_ALIAS_TEMPLATES) 313 314 // Standard library support for system errors. 315 #if !defined(ASIO_HAS_STD_SYSTEM_ERROR) 316 # if !defined(ASIO_DISABLE_STD_SYSTEM_ERROR) 317 # if defined(__clang__) 318 # if defined(ASIO_HAS_CLANG_LIBCXX) 319 # define ASIO_HAS_STD_SYSTEM_ERROR 1 320 # elif (__cplusplus >= 201103) 321 # if __has_include(<system_error>) 322 # define ASIO_HAS_STD_SYSTEM_ERROR 1 323 # endif // __has_include(<system_error>) 324 # endif // (__cplusplus >= 201103) 325 # endif // defined(__clang__) 326 # if defined(__GNUC__) 327 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 328 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 329 # define ASIO_HAS_STD_SYSTEM_ERROR 1 330 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 331 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 332 # endif // defined(__GNUC__) 333 # if defined(ASIO_MSVC) 334 # if (_MSC_VER >= 1700) 335 # define ASIO_HAS_STD_SYSTEM_ERROR 1 336 # endif // (_MSC_VER >= 1700) 337 # endif // defined(ASIO_MSVC) 338 # endif // !defined(ASIO_DISABLE_STD_SYSTEM_ERROR) 339 #endif // !defined(ASIO_HAS_STD_SYSTEM_ERROR) 340 341 // Compliant C++11 compilers put noexcept specifiers on error_category members. 342 #if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) 343 # if (BOOST_VERSION >= 105300) 344 # define ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT 345 # elif defined(__clang__) 346 # if __has_feature(__cxx_noexcept__) 347 # define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) 348 # endif // __has_feature(__cxx_noexcept__) 349 # elif defined(__GNUC__) 350 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 351 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 352 # define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) 353 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 354 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 355 # elif defined(ASIO_MSVC) 356 # if (_MSC_VER >= 1900) 357 # define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) 358 # endif // (_MSC_VER >= 1900) 359 # endif // defined(ASIO_MSVC) 360 # if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) 361 # define ASIO_ERROR_CATEGORY_NOEXCEPT 362 # endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) 363 #endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) 364 365 // Standard library support for arrays. 366 #if !defined(ASIO_HAS_STD_ARRAY) 367 # if !defined(ASIO_DISABLE_STD_ARRAY) 368 # if defined(__clang__) 369 # if defined(ASIO_HAS_CLANG_LIBCXX) 370 # define ASIO_HAS_STD_ARRAY 1 371 # elif (__cplusplus >= 201103) 372 # if __has_include(<array>) 373 # define ASIO_HAS_STD_ARRAY 1 374 # endif // __has_include(<array>) 375 # endif // (__cplusplus >= 201103) 376 # endif // defined(__clang__) 377 # if defined(__GNUC__) 378 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 379 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 380 # define ASIO_HAS_STD_ARRAY 1 381 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 382 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 383 # endif // defined(__GNUC__) 384 # if defined(ASIO_MSVC) 385 # if (_MSC_VER >= 1600) 386 # define ASIO_HAS_STD_ARRAY 1 387 # endif // (_MSC_VER >= 1600) 388 # endif // defined(ASIO_MSVC) 389 # endif // !defined(ASIO_DISABLE_STD_ARRAY) 390 #endif // !defined(ASIO_HAS_STD_ARRAY) 391 392 // Standard library support for shared_ptr and weak_ptr. 393 #if !defined(ASIO_HAS_STD_SHARED_PTR) 394 # if !defined(ASIO_DISABLE_STD_SHARED_PTR) 395 # if defined(__clang__) 396 # if defined(ASIO_HAS_CLANG_LIBCXX) 397 # define ASIO_HAS_STD_SHARED_PTR 1 398 # elif (__cplusplus >= 201103) 399 # define ASIO_HAS_STD_SHARED_PTR 1 400 # endif // (__cplusplus >= 201103) 401 # endif // defined(__clang__) 402 # if defined(__GNUC__) 403 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 404 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 405 # define ASIO_HAS_STD_SHARED_PTR 1 406 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 407 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 408 # endif // defined(__GNUC__) 409 # if defined(ASIO_MSVC) 410 # if (_MSC_VER >= 1600) 411 # define ASIO_HAS_STD_SHARED_PTR 1 412 # endif // (_MSC_VER >= 1600) 413 # endif // defined(ASIO_MSVC) 414 # endif // !defined(ASIO_DISABLE_STD_SHARED_PTR) 415 #endif // !defined(ASIO_HAS_STD_SHARED_PTR) 416 417 // Standard library support for allocator_arg_t. 418 #if !defined(ASIO_HAS_STD_ALLOCATOR_ARG) 419 # if !defined(ASIO_DISABLE_STD_ALLOCATOR_ARG) 420 # if defined(__clang__) 421 # if defined(ASIO_HAS_CLANG_LIBCXX) 422 # define ASIO_HAS_STD_ALLOCATOR_ARG 1 423 # elif (__cplusplus >= 201103) 424 # define ASIO_HAS_STD_ALLOCATOR_ARG 1 425 # endif // (__cplusplus >= 201103) 426 # endif // defined(__clang__) 427 # if defined(__GNUC__) 428 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 429 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 430 # define ASIO_HAS_STD_ALLOCATOR_ARG 1 431 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 432 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 433 # endif // defined(__GNUC__) 434 # if defined(ASIO_MSVC) 435 # if (_MSC_VER >= 1600) 436 # define ASIO_HAS_STD_ALLOCATOR_ARG 1 437 # endif // (_MSC_VER >= 1600) 438 # endif // defined(ASIO_MSVC) 439 # endif // !defined(ASIO_DISABLE_STD_ALLOCATOR_ARG) 440 #endif // !defined(ASIO_HAS_STD_ALLOCATOR_ARG) 441 442 // Standard library support for atomic operations. 443 #if !defined(ASIO_HAS_STD_ATOMIC) 444 # if !defined(ASIO_DISABLE_STD_ATOMIC) 445 # if defined(__clang__) 446 # if defined(ASIO_HAS_CLANG_LIBCXX) 447 # define ASIO_HAS_STD_ATOMIC 1 448 # elif (__cplusplus >= 201103) 449 # if __has_include(<atomic>) 450 # define ASIO_HAS_STD_ATOMIC 1 451 # endif // __has_include(<atomic>) 452 # endif // (__cplusplus >= 201103) 453 # endif // defined(__clang__) 454 # if defined(__GNUC__) 455 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 456 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 457 # define ASIO_HAS_STD_ATOMIC 1 458 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 459 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 460 # endif // defined(__GNUC__) 461 # if defined(ASIO_MSVC) 462 # if (_MSC_VER >= 1700) 463 # define ASIO_HAS_STD_ATOMIC 1 464 # endif // (_MSC_VER >= 1700) 465 # endif // defined(ASIO_MSVC) 466 # endif // !defined(ASIO_DISABLE_STD_ATOMIC) 467 #endif // !defined(ASIO_HAS_STD_ATOMIC) 468 469 // Standard library support for chrono. Some standard libraries (such as the 470 // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x 471 // drafts, rather than the eventually standardised name of steady_clock. 472 #if !defined(ASIO_HAS_STD_CHRONO) 473 # if !defined(ASIO_DISABLE_STD_CHRONO) 474 # if defined(__clang__) 475 # if defined(ASIO_HAS_CLANG_LIBCXX) 476 # define ASIO_HAS_STD_CHRONO 1 477 # elif (__cplusplus >= 201103) 478 # if __has_include(<chrono>) 479 # define ASIO_HAS_STD_CHRONO 1 480 # endif // __has_include(<chrono>) 481 # endif // (__cplusplus >= 201103) 482 # endif // defined(__clang__) 483 # if defined(__GNUC__) 484 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 485 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 486 # define ASIO_HAS_STD_CHRONO 1 487 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) 488 # define ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1 489 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) 490 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 491 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 492 # endif // defined(__GNUC__) 493 # if defined(ASIO_MSVC) 494 # if (_MSC_VER >= 1700) 495 # define ASIO_HAS_STD_CHRONO 1 496 # endif // (_MSC_VER >= 1700) 497 # endif // defined(ASIO_MSVC) 498 # endif // !defined(ASIO_DISABLE_STD_CHRONO) 499 #endif // !defined(ASIO_HAS_STD_CHRONO) 500 501 // Boost support for chrono. 502 #if !defined(ASIO_HAS_BOOST_CHRONO) 503 # if !defined(ASIO_DISABLE_BOOST_CHRONO) 504 # if (BOOST_VERSION >= 104700) 505 # define ASIO_HAS_BOOST_CHRONO 1 506 # endif // (BOOST_VERSION >= 104700) 507 # endif // !defined(ASIO_DISABLE_BOOST_CHRONO) 508 #endif // !defined(ASIO_HAS_BOOST_CHRONO) 509 510 // Some form of chrono library is available. 511 #if !defined(ASIO_HAS_CHRONO) 512 # if defined(ASIO_HAS_STD_CHRONO) \ 513 || defined(ASIO_HAS_BOOST_CHRONO) 514 # define ASIO_HAS_CHRONO 1 515 # endif // defined(ASIO_HAS_STD_CHRONO) 516 // || defined(ASIO_HAS_BOOST_CHRONO) 517 #endif // !defined(ASIO_HAS_CHRONO) 518 519 // Boost support for the DateTime library. 520 #if !defined(ASIO_HAS_BOOST_DATE_TIME) 521 # if !defined(ASIO_DISABLE_BOOST_DATE_TIME) 522 # define ASIO_HAS_BOOST_DATE_TIME 1 523 # endif // !defined(ASIO_DISABLE_BOOST_DATE_TIME) 524 #endif // !defined(ASIO_HAS_BOOST_DATE_TIME) 525 526 // Standard library support for addressof. 527 #if !defined(ASIO_HAS_STD_ADDRESSOF) 528 # if !defined(ASIO_DISABLE_STD_ADDRESSOF) 529 # if defined(__clang__) 530 # if defined(ASIO_HAS_CLANG_LIBCXX) 531 # define ASIO_HAS_STD_ADDRESSOF 1 532 # elif (__cplusplus >= 201103) 533 # define ASIO_HAS_STD_ADDRESSOF 1 534 # endif // (__cplusplus >= 201103) 535 # endif // defined(__clang__) 536 # if defined(__GNUC__) 537 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 538 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 539 # define ASIO_HAS_STD_ADDRESSOF 1 540 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 541 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 542 # endif // defined(__GNUC__) 543 # if defined(ASIO_MSVC) 544 # if (_MSC_VER >= 1700) 545 # define ASIO_HAS_STD_ADDRESSOF 1 546 # endif // (_MSC_VER >= 1700) 547 # endif // defined(ASIO_MSVC) 548 # endif // !defined(ASIO_DISABLE_STD_ADDRESSOF) 549 #endif // !defined(ASIO_HAS_STD_ADDRESSOF) 550 551 // Standard library support for the function class. 552 #if !defined(ASIO_HAS_STD_FUNCTION) 553 # if !defined(ASIO_DISABLE_STD_FUNCTION) 554 # if defined(__clang__) 555 # if defined(ASIO_HAS_CLANG_LIBCXX) 556 # define ASIO_HAS_STD_FUNCTION 1 557 # elif (__cplusplus >= 201103) 558 # define ASIO_HAS_STD_FUNCTION 1 559 # endif // (__cplusplus >= 201103) 560 # endif // defined(__clang__) 561 # if defined(__GNUC__) 562 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 563 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 564 # define ASIO_HAS_STD_FUNCTION 1 565 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 566 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 567 # endif // defined(__GNUC__) 568 # if defined(ASIO_MSVC) 569 # if (_MSC_VER >= 1700) 570 # define ASIO_HAS_STD_FUNCTION 1 571 # endif // (_MSC_VER >= 1700) 572 # endif // defined(ASIO_MSVC) 573 # endif // !defined(ASIO_DISABLE_STD_FUNCTION) 574 #endif // !defined(ASIO_HAS_STD_FUNCTION) 575 576 // Standard library support for type traits. 577 #if !defined(ASIO_HAS_STD_TYPE_TRAITS) 578 # if !defined(ASIO_DISABLE_STD_TYPE_TRAITS) 579 # if defined(__clang__) 580 # if defined(ASIO_HAS_CLANG_LIBCXX) 581 # define ASIO_HAS_STD_TYPE_TRAITS 1 582 # elif (__cplusplus >= 201103) 583 # if __has_include(<type_traits>) 584 # define ASIO_HAS_STD_TYPE_TRAITS 1 585 # endif // __has_include(<type_traits>) 586 # endif // (__cplusplus >= 201103) 587 # endif // defined(__clang__) 588 # if defined(__GNUC__) 589 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 590 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 591 # define ASIO_HAS_STD_TYPE_TRAITS 1 592 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 593 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 594 # endif // defined(__GNUC__) 595 # if defined(ASIO_MSVC) 596 # if (_MSC_VER >= 1700) 597 # define ASIO_HAS_STD_TYPE_TRAITS 1 598 # endif // (_MSC_VER >= 1700) 599 # endif // defined(ASIO_MSVC) 600 # endif // !defined(ASIO_DISABLE_STD_TYPE_TRAITS) 601 #endif // !defined(ASIO_HAS_STD_TYPE_TRAITS) 602 603 // Standard library support for the nullptr_t type. 604 #if !defined(ASIO_HAS_NULLPTR) 605 # if !defined(ASIO_DISABLE_NULLPTR) 606 # if defined(__clang__) 607 # if __has_feature(__cxx_nullptr__) 608 # define ASIO_HAS_NULLPTR 1 609 # endif // __has_feature(__cxx_rvalue_references__) 610 # elif defined(__GNUC__) 611 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 612 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 613 # define ASIO_HAS_NULLPTR 1 614 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 615 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 616 # endif // defined(__GNUC__) 617 # if defined(ASIO_MSVC) 618 # if (_MSC_VER >= 1700) 619 # define ASIO_HAS_NULLPTR 1 620 # endif // (_MSC_VER >= 1700) 621 # endif // defined(ASIO_MSVC) 622 # endif // !defined(ASIO_DISABLE_NULLPTR) 623 #endif // !defined(ASIO_HAS_NULLPTR) 624 625 // Standard library support for the C++11 allocator additions. 626 #if !defined(ASIO_HAS_CXX11_ALLOCATORS) 627 # if !defined(ASIO_DISABLE_CXX11_ALLOCATORS) 628 # if defined(__clang__) 629 # if defined(ASIO_HAS_CLANG_LIBCXX) 630 # define ASIO_HAS_CXX11_ALLOCATORS 1 631 # elif (__cplusplus >= 201103) 632 # define ASIO_HAS_CXX11_ALLOCATORS 1 633 # endif // (__cplusplus >= 201103) 634 # elif defined(__GNUC__) 635 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 636 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 637 # define ASIO_HAS_CXX11_ALLOCATORS 1 638 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 639 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 640 # endif // defined(__GNUC__) 641 # if defined(ASIO_MSVC) 642 # if (_MSC_VER >= 1700) 643 # define ASIO_HAS_CXX11_ALLOCATORS 1 644 # endif // (_MSC_VER >= 1700) 645 # endif // defined(ASIO_MSVC) 646 # endif // !defined(ASIO_DISABLE_CXX11_ALLOCATORS) 647 #endif // !defined(ASIO_HAS_CXX11_ALLOCATORS) 648 649 // Standard library support for the cstdint header. 650 #if !defined(ASIO_HAS_CSTDINT) 651 # if !defined(ASIO_DISABLE_CSTDINT) 652 # if defined(__clang__) 653 # if defined(ASIO_HAS_CLANG_LIBCXX) 654 # define ASIO_HAS_CSTDINT 1 655 # elif (__cplusplus >= 201103) 656 # define ASIO_HAS_CSTDINT 1 657 # endif // (__cplusplus >= 201103) 658 # endif // defined(__clang__) 659 # if defined(__GNUC__) 660 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 661 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 662 # define ASIO_HAS_CSTDINT 1 663 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 664 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 665 # endif // defined(__GNUC__) 666 # if defined(ASIO_MSVC) 667 # if (_MSC_VER >= 1700) 668 # define ASIO_HAS_CSTDINT 1 669 # endif // (_MSC_VER >= 1700) 670 # endif // defined(ASIO_MSVC) 671 # endif // !defined(ASIO_DISABLE_CSTDINT) 672 #endif // !defined(ASIO_HAS_CSTDINT) 673 674 // Standard library support for the thread class. 675 #if !defined(ASIO_HAS_STD_THREAD) 676 # if !defined(ASIO_DISABLE_STD_THREAD) 677 # if defined(__clang__) 678 # if defined(ASIO_HAS_CLANG_LIBCXX) 679 # define ASIO_HAS_STD_THREAD 1 680 # elif (__cplusplus >= 201103) 681 # if __has_include(<thread>) 682 # define ASIO_HAS_STD_THREAD 1 683 # endif // __has_include(<thread>) 684 # endif // (__cplusplus >= 201103) 685 # endif // defined(__clang__) 686 # if defined(__GNUC__) 687 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 688 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 689 # define ASIO_HAS_STD_THREAD 1 690 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 691 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 692 # endif // defined(__GNUC__) 693 # if defined(ASIO_MSVC) 694 # if (_MSC_VER >= 1700) 695 # define ASIO_HAS_STD_THREAD 1 696 # endif // (_MSC_VER >= 1700) 697 # endif // defined(ASIO_MSVC) 698 # endif // !defined(ASIO_DISABLE_STD_THREAD) 699 #endif // !defined(ASIO_HAS_STD_THREAD) 700 701 // Standard library support for the mutex and condition variable classes. 702 #if !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 703 # if !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR) 704 # if defined(__clang__) 705 # if defined(ASIO_HAS_CLANG_LIBCXX) 706 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 707 # elif (__cplusplus >= 201103) 708 # if __has_include(<mutex>) 709 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 710 # endif // __has_include(<mutex>) 711 # endif // (__cplusplus >= 201103) 712 # endif // defined(__clang__) 713 # if defined(__GNUC__) 714 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 715 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 716 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 717 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 718 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 719 # endif // defined(__GNUC__) 720 # if defined(ASIO_MSVC) 721 # if (_MSC_VER >= 1700) 722 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 723 # endif // (_MSC_VER >= 1700) 724 # endif // defined(ASIO_MSVC) 725 # endif // !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR) 726 #endif // !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 727 728 // Standard library support for the call_once function. 729 #if !defined(ASIO_HAS_STD_CALL_ONCE) 730 # if !defined(ASIO_DISABLE_STD_CALL_ONCE) 731 # if defined(__clang__) 732 # if defined(ASIO_HAS_CLANG_LIBCXX) 733 # define ASIO_HAS_STD_CALL_ONCE 1 734 # elif (__cplusplus >= 201103) 735 # if __has_include(<mutex>) 736 # define ASIO_HAS_STD_CALL_ONCE 1 737 # endif // __has_include(<mutex>) 738 # endif // (__cplusplus >= 201103) 739 # endif // defined(__clang__) 740 # if defined(__GNUC__) 741 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 742 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 743 # define ASIO_HAS_STD_CALL_ONCE 1 744 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 745 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 746 # endif // defined(__GNUC__) 747 # if defined(ASIO_MSVC) 748 # if (_MSC_VER >= 1700) 749 # define ASIO_HAS_STD_CALL_ONCE 1 750 # endif // (_MSC_VER >= 1700) 751 # endif // defined(ASIO_MSVC) 752 # endif // !defined(ASIO_DISABLE_STD_CALL_ONCE) 753 #endif // !defined(ASIO_HAS_STD_CALL_ONCE) 754 755 // Standard library support for futures. 756 #if !defined(ASIO_HAS_STD_FUTURE) 757 # if !defined(ASIO_DISABLE_STD_FUTURE) 758 # if defined(__clang__) 759 # if defined(ASIO_HAS_CLANG_LIBCXX) 760 # define ASIO_HAS_STD_FUTURE 1 761 # elif (__cplusplus >= 201103) 762 # if __has_include(<future>) 763 # define ASIO_HAS_STD_FUTURE 1 764 # endif // __has_include(<mutex>) 765 # endif // (__cplusplus >= 201103) 766 # endif // defined(__clang__) 767 # if defined(__GNUC__) 768 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 769 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 770 # define ASIO_HAS_STD_FUTURE 1 771 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 772 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 773 # endif // defined(__GNUC__) 774 # if defined(ASIO_MSVC) 775 # if (_MSC_VER >= 1700) 776 # define ASIO_HAS_STD_FUTURE 1 777 # endif // (_MSC_VER >= 1700) 778 # endif // defined(ASIO_MSVC) 779 # endif // !defined(ASIO_DISABLE_STD_FUTURE) 780 #endif // !defined(ASIO_HAS_STD_FUTURE) 781 782 // Standard library support for experimental::string_view. 783 #if !defined(ASIO_HAS_STD_STRING_VIEW) 784 # if !defined(ASIO_DISABLE_STD_STRING_VIEW) 785 # if defined(__clang__) 786 # if (__cplusplus >= 201402) 787 # if __has_include(<string_view>) 788 # define ASIO_HAS_STD_STRING_VIEW 1 789 # elif __has_include(<experimental/string_view>) 790 # define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 791 # endif // __has_include(<experimental/string_view>) 792 # endif // (__cplusplus >= 201402) 793 # endif // defined(__clang__) 794 # if defined(__GNUC__) 795 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4) 796 # if (__cplusplus >= 201402) 797 # define ASIO_HAS_STD_STRING_VIEW 1 798 # define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 799 # endif // (__cplusplus >= 201402) 800 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 801 # endif // defined(__GNUC__) 802 # if defined(ASIO_MSVC) 803 # if (_MSC_VER >= 1910 && _HAS_CXX17) 804 # define ASIO_HAS_STD_STRING_VIEW 805 # endif // (_MSC_VER >= 1910) 806 # endif // defined(ASIO_MSVC) 807 # endif // !defined(ASIO_DISABLE_STD_STRING_VIEW) 808 #endif // !defined(ASIO_HAS_STD_STRING_VIEW) 809 810 // Standard library support for iostream move construction and assignment. 811 #if !defined(ASIO_HAS_STD_IOSTREAM_MOVE) 812 # if !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE) 813 # if defined(__GNUC__) 814 # if (__GNUC__ > 4) 815 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 816 # define ASIO_HAS_STD_IOSTREAM_MOVE 1 817 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 818 # endif // (__GNUC__ > 4) 819 # endif // defined(__GNUC__) 820 # if defined(ASIO_MSVC) 821 # if (_MSC_VER >= 1700) 822 # define ASIO_HAS_STD_IOSTREAM_MOVE 1 823 # endif // (_MSC_VER >= 1700) 824 # endif // defined(ASIO_MSVC) 825 # endif // !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE) 826 #endif // !defined(ASIO_HAS_STD_IOSTREAM_MOVE) 827 828 // Windows App target. Windows but with a limited API. 829 #if !defined(ASIO_WINDOWS_APP) 830 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603) 831 # include <winapifamily.h> 832 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \ 833 && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 834 # define ASIO_WINDOWS_APP 1 835 # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) 836 // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 837 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603) 838 #endif // !defined(ASIO_WINDOWS_APP) 839 840 // Legacy WinRT target. Windows App is preferred. 841 #if !defined(ASIO_WINDOWS_RUNTIME) 842 # if !defined(ASIO_WINDOWS_APP) 843 # if defined(__cplusplus_winrt) 844 # include <winapifamily.h> 845 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \ 846 && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 847 # define ASIO_WINDOWS_RUNTIME 1 848 # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) 849 // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 850 # endif // defined(__cplusplus_winrt) 851 # endif // !defined(ASIO_WINDOWS_APP) 852 #endif // !defined(ASIO_WINDOWS_RUNTIME) 853 854 // Windows target. Excludes WinRT but includes Windows App targets. 855 #if !defined(ASIO_WINDOWS) 856 # if !defined(ASIO_WINDOWS_RUNTIME) 857 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS) 858 # define ASIO_WINDOWS 1 859 # elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) 860 # define ASIO_WINDOWS 1 861 # elif defined(ASIO_WINDOWS_APP) 862 # define ASIO_WINDOWS 1 863 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS) 864 # endif // !defined(ASIO_WINDOWS_RUNTIME) 865 #endif // !defined(ASIO_WINDOWS) 866 867 // Windows: target OS version. 868 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 869 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS) 870 # if defined(_MSC_VER) || defined(__BORLANDC__) 871 # pragma message( \ 872 "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\ 873 "- add -D_WIN32_WINNT=0x0501 to the compiler command line; or\n"\ 874 "- add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.\n"\ 875 "Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).") 876 # else // defined(_MSC_VER) || defined(__BORLANDC__) 877 # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. 878 # warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line. 879 # warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). 880 # endif // defined(_MSC_VER) || defined(__BORLANDC__) 881 # define _WIN32_WINNT 0x0501 882 # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS) 883 # if defined(_MSC_VER) 884 # if defined(_WIN32) && !defined(WIN32) 885 # if !defined(_WINSOCK2API_) 886 # define WIN32 // Needed for correct types in winsock2.h 887 # else // !defined(_WINSOCK2API_) 888 # error Please define the macro WIN32 in your compiler options 889 # endif // !defined(_WINSOCK2API_) 890 # endif // defined(_WIN32) && !defined(WIN32) 891 # endif // defined(_MSC_VER) 892 # if defined(__BORLANDC__) 893 # if defined(__WIN32__) && !defined(WIN32) 894 # if !defined(_WINSOCK2API_) 895 # define WIN32 // Needed for correct types in winsock2.h 896 # else // !defined(_WINSOCK2API_) 897 # error Please define the macro WIN32 in your compiler options 898 # endif // !defined(_WINSOCK2API_) 899 # endif // defined(__WIN32__) && !defined(WIN32) 900 # endif // defined(__BORLANDC__) 901 # if defined(__CYGWIN__) 902 # if !defined(__USE_W32_SOCKETS) 903 # error You must add -D__USE_W32_SOCKETS to your compiler options. 904 # endif // !defined(__USE_W32_SOCKETS) 905 # endif // defined(__CYGWIN__) 906 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 907 908 // Windows: minimise header inclusion. 909 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 910 # if !defined(ASIO_NO_WIN32_LEAN_AND_MEAN) 911 # if !defined(WIN32_LEAN_AND_MEAN) 912 # define WIN32_LEAN_AND_MEAN 913 # endif // !defined(WIN32_LEAN_AND_MEAN) 914 # endif // !defined(ASIO_NO_WIN32_LEAN_AND_MEAN) 915 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 916 917 // Windows: suppress definition of "min" and "max" macros. 918 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 919 # if !defined(ASIO_NO_NOMINMAX) 920 # if !defined(NOMINMAX) 921 # define NOMINMAX 1 922 # endif // !defined(NOMINMAX) 923 # endif // !defined(ASIO_NO_NOMINMAX) 924 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 925 926 // Windows: IO Completion Ports. 927 #if !defined(ASIO_HAS_IOCP) 928 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 929 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400) 930 # if !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) 931 # if !defined(ASIO_DISABLE_IOCP) 932 # define ASIO_HAS_IOCP 1 933 # endif // !defined(ASIO_DISABLE_IOCP) 934 # endif // !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) 935 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400) 936 # endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 937 #endif // !defined(ASIO_HAS_IOCP) 938 939 // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to 940 // get access to the various platform feature macros, e.g. to be able to test 941 // for threads support. 942 #if !defined(ASIO_HAS_UNISTD_H) 943 # if !defined(ASIO_HAS_BOOST_CONFIG) 944 # if defined(unix) \ 945 || defined(__unix) \ 946 || defined(_XOPEN_SOURCE) \ 947 || defined(_POSIX_SOURCE) \ 948 || (defined(__MACH__) && defined(__APPLE__)) \ 949 || defined(__FreeBSD__) \ 950 || defined(__NetBSD__) \ 951 || defined(__OpenBSD__) \ 952 || defined(__linux__) 953 # define ASIO_HAS_UNISTD_H 1 954 # endif 955 # endif // !defined(ASIO_HAS_BOOST_CONFIG) 956 #endif // !defined(ASIO_HAS_UNISTD_H) 957 #if defined(ASIO_HAS_UNISTD_H) 958 # include <unistd.h> 959 #endif // defined(ASIO_HAS_UNISTD_H) 960 961 // Linux: epoll, eventfd and timerfd. 962 #if defined(__linux__) 963 # include <linux/version.h> 964 # if !defined(ASIO_HAS_EPOLL) 965 # if !defined(ASIO_DISABLE_EPOLL) 966 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45) 967 # define ASIO_HAS_EPOLL 1 968 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45) 969 # endif // !defined(ASIO_DISABLE_EPOLL) 970 # endif // !defined(ASIO_HAS_EPOLL) 971 # if !defined(ASIO_HAS_EVENTFD) 972 # if !defined(ASIO_DISABLE_EVENTFD) 973 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 974 # define ASIO_HAS_EVENTFD 1 975 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 976 # endif // !defined(ASIO_DISABLE_EVENTFD) 977 # endif // !defined(ASIO_HAS_EVENTFD) 978 # if !defined(ASIO_HAS_TIMERFD) 979 # if defined(ASIO_HAS_EPOLL) 980 # if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) 981 # define ASIO_HAS_TIMERFD 1 982 # endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) 983 # endif // defined(ASIO_HAS_EPOLL) 984 # endif // !defined(ASIO_HAS_TIMERFD) 985 #endif // defined(__linux__) 986 987 // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue. 988 #if (defined(__MACH__) && defined(__APPLE__)) \ 989 || defined(__FreeBSD__) \ 990 || defined(__NetBSD__) \ 991 || defined(__OpenBSD__) 992 # if !defined(ASIO_HAS_KQUEUE) 993 # if !defined(ASIO_DISABLE_KQUEUE) 994 # define ASIO_HAS_KQUEUE 1 995 # endif // !defined(ASIO_DISABLE_KQUEUE) 996 # endif // !defined(ASIO_HAS_KQUEUE) 997 #endif // (defined(__MACH__) && defined(__APPLE__)) 998 // || defined(__FreeBSD__) 999 // || defined(__NetBSD__) 1000 // || defined(__OpenBSD__) 1001 1002 // Solaris: /dev/poll. 1003 #if defined(__sun) 1004 # if !defined(ASIO_HAS_DEV_POLL) 1005 # if !defined(ASIO_DISABLE_DEV_POLL) 1006 # define ASIO_HAS_DEV_POLL 1 1007 # endif // !defined(ASIO_DISABLE_DEV_POLL) 1008 # endif // !defined(ASIO_HAS_DEV_POLL) 1009 #endif // defined(__sun) 1010 1011 // Serial ports. 1012 #if !defined(ASIO_HAS_SERIAL_PORT) 1013 # if defined(ASIO_HAS_IOCP) \ 1014 || !defined(ASIO_WINDOWS) \ 1015 && !defined(ASIO_WINDOWS_RUNTIME) \ 1016 && !defined(__CYGWIN__) 1017 # if !defined(__SYMBIAN32__) 1018 # if !defined(ASIO_DISABLE_SERIAL_PORT) 1019 # define ASIO_HAS_SERIAL_PORT 1 1020 # endif // !defined(ASIO_DISABLE_SERIAL_PORT) 1021 # endif // !defined(__SYMBIAN32__) 1022 # endif // defined(ASIO_HAS_IOCP) 1023 // || !defined(ASIO_WINDOWS) 1024 // && !defined(ASIO_WINDOWS_RUNTIME) 1025 // && !defined(__CYGWIN__) 1026 #endif // !defined(ASIO_HAS_SERIAL_PORT) 1027 1028 // Windows: stream handles. 1029 #if !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) 1030 # if !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE) 1031 # if defined(ASIO_HAS_IOCP) 1032 # define ASIO_HAS_WINDOWS_STREAM_HANDLE 1 1033 # endif // defined(ASIO_HAS_IOCP) 1034 # endif // !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE) 1035 #endif // !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) 1036 1037 // Windows: random access handles. 1038 #if !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) 1039 # if !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE) 1040 # if defined(ASIO_HAS_IOCP) 1041 # define ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1 1042 # endif // defined(ASIO_HAS_IOCP) 1043 # endif // !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE) 1044 #endif // !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) 1045 1046 // Windows: object handles. 1047 #if !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) 1048 # if !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE) 1049 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 1050 # if !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) 1051 # define ASIO_HAS_WINDOWS_OBJECT_HANDLE 1 1052 # endif // !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) 1053 # endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 1054 # endif // !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE) 1055 #endif // !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) 1056 1057 // Windows: OVERLAPPED wrapper. 1058 #if !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) 1059 # if !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR) 1060 # if defined(ASIO_HAS_IOCP) 1061 # define ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1 1062 # endif // defined(ASIO_HAS_IOCP) 1063 # endif // !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR) 1064 #endif // !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) 1065 1066 // POSIX: stream-oriented file descriptors. 1067 #if !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) 1068 # if !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) 1069 # if !defined(ASIO_WINDOWS) \ 1070 && !defined(ASIO_WINDOWS_RUNTIME) \ 1071 && !defined(__CYGWIN__) 1072 # define ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1 1073 # endif // !defined(ASIO_WINDOWS) 1074 // && !defined(ASIO_WINDOWS_RUNTIME) 1075 // && !defined(__CYGWIN__) 1076 # endif // !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) 1077 #endif // !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) 1078 1079 // UNIX domain sockets. 1080 #if !defined(ASIO_HAS_LOCAL_SOCKETS) 1081 # if !defined(ASIO_DISABLE_LOCAL_SOCKETS) 1082 # if !defined(ASIO_WINDOWS) \ 1083 && !defined(ASIO_WINDOWS_RUNTIME) \ 1084 && !defined(__CYGWIN__) 1085 # define ASIO_HAS_LOCAL_SOCKETS 1 1086 # endif // !defined(ASIO_WINDOWS) 1087 // && !defined(ASIO_WINDOWS_RUNTIME) 1088 // && !defined(__CYGWIN__) 1089 # endif // !defined(ASIO_DISABLE_LOCAL_SOCKETS) 1090 #endif // !defined(ASIO_HAS_LOCAL_SOCKETS) 1091 1092 // Can use sigaction() instead of signal(). 1093 #if !defined(ASIO_HAS_SIGACTION) 1094 # if !defined(ASIO_DISABLE_SIGACTION) 1095 # if !defined(ASIO_WINDOWS) \ 1096 && !defined(ASIO_WINDOWS_RUNTIME) \ 1097 && !defined(__CYGWIN__) 1098 # define ASIO_HAS_SIGACTION 1 1099 # endif // !defined(ASIO_WINDOWS) 1100 // && !defined(ASIO_WINDOWS_RUNTIME) 1101 // && !defined(__CYGWIN__) 1102 # endif // !defined(ASIO_DISABLE_SIGACTION) 1103 #endif // !defined(ASIO_HAS_SIGACTION) 1104 1105 // Can use signal(). 1106 #if !defined(ASIO_HAS_SIGNAL) 1107 # if !defined(ASIO_DISABLE_SIGNAL) 1108 # if !defined(UNDER_CE) 1109 # define ASIO_HAS_SIGNAL 1 1110 # endif // !defined(UNDER_CE) 1111 # endif // !defined(ASIO_DISABLE_SIGNAL) 1112 #endif // !defined(ASIO_HAS_SIGNAL) 1113 1114 // Can use getaddrinfo() and getnameinfo(). 1115 #if !defined(ASIO_HAS_GETADDRINFO) 1116 # if !defined(ASIO_DISABLE_GETADDRINFO) 1117 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 1118 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) 1119 # define ASIO_HAS_GETADDRINFO 1 1120 # elif defined(UNDER_CE) 1121 # define ASIO_HAS_GETADDRINFO 1 1122 # endif // defined(UNDER_CE) 1123 # elif defined(__MACH__) && defined(__APPLE__) 1124 # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 1125 # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) 1126 # define ASIO_HAS_GETADDRINFO 1 1127 # endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) 1128 # else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 1129 # define ASIO_HAS_GETADDRINFO 1 1130 # endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 1131 # else // defined(__MACH__) && defined(__APPLE__) 1132 # define ASIO_HAS_GETADDRINFO 1 1133 # endif // defined(__MACH__) && defined(__APPLE__) 1134 # endif // !defined(ASIO_DISABLE_GETADDRINFO) 1135 #endif // !defined(ASIO_HAS_GETADDRINFO) 1136 1137 // Whether standard iostreams are disabled. 1138 #if !defined(ASIO_NO_IOSTREAM) 1139 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM) 1140 # define ASIO_NO_IOSTREAM 1 1141 # endif // !defined(BOOST_NO_IOSTREAM) 1142 #endif // !defined(ASIO_NO_IOSTREAM) 1143 1144 // Whether exception handling is disabled. 1145 #if !defined(ASIO_NO_EXCEPTIONS) 1146 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS) 1147 # define ASIO_NO_EXCEPTIONS 1 1148 # endif // !defined(BOOST_NO_EXCEPTIONS) 1149 #endif // !defined(ASIO_NO_EXCEPTIONS) 1150 1151 // Whether the typeid operator is supported. 1152 #if !defined(ASIO_NO_TYPEID) 1153 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID) 1154 # define ASIO_NO_TYPEID 1 1155 # endif // !defined(BOOST_NO_TYPEID) 1156 #endif // !defined(ASIO_NO_TYPEID) 1157 1158 // Threads. 1159 #if !defined(ASIO_HAS_THREADS) 1160 # if !defined(ASIO_DISABLE_THREADS) 1161 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS) 1162 # define ASIO_HAS_THREADS 1 1163 # elif defined(__GNUC__) && !defined(__MINGW32__) \ 1164 && !defined(linux) && !defined(__linux) && !defined(__linux__) 1165 # define ASIO_HAS_THREADS 1 1166 # elif defined(_MT) || defined(__MT__) 1167 # define ASIO_HAS_THREADS 1 1168 # elif defined(_REENTRANT) 1169 # define ASIO_HAS_THREADS 1 1170 # elif defined(__APPLE__) 1171 # define ASIO_HAS_THREADS 1 1172 # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0) 1173 # define ASIO_HAS_THREADS 1 1174 # elif defined(_PTHREADS) 1175 # define ASIO_HAS_THREADS 1 1176 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS) 1177 # endif // !defined(ASIO_DISABLE_THREADS) 1178 #endif // !defined(ASIO_HAS_THREADS) 1179 1180 // POSIX threads. 1181 #if !defined(ASIO_HAS_PTHREADS) 1182 # if defined(ASIO_HAS_THREADS) 1183 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS) 1184 # define ASIO_HAS_PTHREADS 1 1185 # elif defined(_POSIX_THREADS) && (_POSIX_THREADS + 0 >= 0) 1186 # define ASIO_HAS_PTHREADS 1 1187 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS) 1188 # endif // defined(ASIO_HAS_THREADS) 1189 #endif // !defined(ASIO_HAS_PTHREADS) 1190 1191 // Helper to prevent macro expansion. 1192 #define ASIO_PREVENT_MACRO_SUBSTITUTION 1193 1194 // Helper to define in-class constants. 1195 #if !defined(ASIO_STATIC_CONSTANT) 1196 # if !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) 1197 # define ASIO_STATIC_CONSTANT(type, assignment) \ 1198 BOOST_STATIC_CONSTANT(type, assignment) 1199 # else // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) 1200 # define ASIO_STATIC_CONSTANT(type, assignment) \ 1201 static const type assignment 1202 # endif // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) 1203 #endif // !defined(ASIO_STATIC_CONSTANT) 1204 1205 // Boost array library. 1206 #if !defined(ASIO_HAS_BOOST_ARRAY) 1207 # if !defined(ASIO_DISABLE_BOOST_ARRAY) 1208 # define ASIO_HAS_BOOST_ARRAY 1 1209 # endif // !defined(ASIO_DISABLE_BOOST_ARRAY) 1210 #endif // !defined(ASIO_HAS_BOOST_ARRAY) 1211 1212 // Boost assert macro. 1213 #if !defined(ASIO_HAS_BOOST_ASSERT) 1214 # if !defined(ASIO_DISABLE_BOOST_ASSERT) 1215 # define ASIO_HAS_BOOST_ASSERT 1 1216 # endif // !defined(ASIO_DISABLE_BOOST_ASSERT) 1217 #endif // !defined(ASIO_HAS_BOOST_ASSERT) 1218 1219 // Boost limits header. 1220 #if !defined(ASIO_HAS_BOOST_LIMITS) 1221 # if !defined(ASIO_DISABLE_BOOST_LIMITS) 1222 # define ASIO_HAS_BOOST_LIMITS 1 1223 # endif // !defined(ASIO_DISABLE_BOOST_LIMITS) 1224 #endif // !defined(ASIO_HAS_BOOST_LIMITS) 1225 1226 // Boost throw_exception function. 1227 #if !defined(ASIO_HAS_BOOST_THROW_EXCEPTION) 1228 # if !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION) 1229 # define ASIO_HAS_BOOST_THROW_EXCEPTION 1 1230 # endif // !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION) 1231 #endif // !defined(ASIO_HAS_BOOST_THROW_EXCEPTION) 1232 1233 // Boost regex library. 1234 #if !defined(ASIO_HAS_BOOST_REGEX) 1235 # if !defined(ASIO_DISABLE_BOOST_REGEX) 1236 # define ASIO_HAS_BOOST_REGEX 1 1237 # endif // !defined(ASIO_DISABLE_BOOST_REGEX) 1238 #endif // !defined(ASIO_HAS_BOOST_REGEX) 1239 1240 // Boost bind function. 1241 #if !defined(ASIO_HAS_BOOST_BIND) 1242 # if !defined(ASIO_DISABLE_BOOST_BIND) 1243 # define ASIO_HAS_BOOST_BIND 1 1244 # endif // !defined(ASIO_DISABLE_BOOST_BIND) 1245 #endif // !defined(ASIO_HAS_BOOST_BIND) 1246 1247 // Boost's BOOST_WORKAROUND macro. 1248 #if !defined(ASIO_HAS_BOOST_WORKAROUND) 1249 # if !defined(ASIO_DISABLE_BOOST_WORKAROUND) 1250 # define ASIO_HAS_BOOST_WORKAROUND 1 1251 # endif // !defined(ASIO_DISABLE_BOOST_WORKAROUND) 1252 #endif // !defined(ASIO_HAS_BOOST_WORKAROUND) 1253 1254 // Microsoft Visual C++'s secure C runtime library. 1255 #if !defined(ASIO_HAS_SECURE_RTL) 1256 # if !defined(ASIO_DISABLE_SECURE_RTL) 1257 # if defined(ASIO_MSVC) \ 1258 && (ASIO_MSVC >= 1400) \ 1259 && !defined(UNDER_CE) 1260 # define ASIO_HAS_SECURE_RTL 1 1261 # endif // defined(ASIO_MSVC) 1262 // && (ASIO_MSVC >= 1400) 1263 // && !defined(UNDER_CE) 1264 # endif // !defined(ASIO_DISABLE_SECURE_RTL) 1265 #endif // !defined(ASIO_HAS_SECURE_RTL) 1266 1267 // Handler hooking. Disabled for ancient Borland C++ and gcc compilers. 1268 #if !defined(ASIO_HAS_HANDLER_HOOKS) 1269 # if !defined(ASIO_DISABLE_HANDLER_HOOKS) 1270 # if defined(__GNUC__) 1271 # if (__GNUC__ >= 3) 1272 # define ASIO_HAS_HANDLER_HOOKS 1 1273 # endif // (__GNUC__ >= 3) 1274 # elif !defined(__BORLANDC__) 1275 # define ASIO_HAS_HANDLER_HOOKS 1 1276 # endif // !defined(__BORLANDC__) 1277 # endif // !defined(ASIO_DISABLE_HANDLER_HOOKS) 1278 #endif // !defined(ASIO_HAS_HANDLER_HOOKS) 1279 1280 // Support for the __thread keyword extension. 1281 #if !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) 1282 # if defined(__linux__) 1283 # if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 1284 # if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3) 1285 # if !defined(__INTEL_COMPILER) && !defined(__ICL) \ 1286 && !(defined(__clang__) && defined(__ANDROID__)) 1287 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 1288 # define ASIO_THREAD_KEYWORD __thread 1289 # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100) 1290 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 1291 # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100) 1292 // && !(defined(__clang__) && defined(__ANDROID__)) 1293 # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3) 1294 # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 1295 # endif // defined(__linux__) 1296 # if defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME) 1297 # if (_MSC_VER >= 1700) 1298 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 1299 # define ASIO_THREAD_KEYWORD __declspec(thread) 1300 # endif // (_MSC_VER >= 1700) 1301 # endif // defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME) 1302 #endif // !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) 1303 #if !defined(ASIO_THREAD_KEYWORD) 1304 # define ASIO_THREAD_KEYWORD __thread 1305 #endif // !defined(ASIO_THREAD_KEYWORD) 1306 1307 // Support for POSIX ssize_t typedef. 1308 #if !defined(ASIO_DISABLE_SSIZE_T) 1309 # if defined(__linux__) \ 1310 || (defined(__MACH__) && defined(__APPLE__)) 1311 # define ASIO_HAS_SSIZE_T 1 1312 # endif // defined(__linux__) 1313 // || (defined(__MACH__) && defined(__APPLE__)) 1314 #endif // !defined(ASIO_DISABLE_SSIZE_T) 1315 1316 // Helper macros to manage the transition away from the old services-based API. 1317 #if defined(ASIO_ENABLE_OLD_SERVICES) 1318 # define ASIO_SVC_TPARAM , typename Service 1319 # define ASIO_SVC_TPARAM_DEF1(d1) , typename Service d1 1320 # define ASIO_SVC_TPARAM_DEF2(d1, d2) , typename Service d1, d2 1321 # define ASIO_SVC_TARG , Service 1322 # define ASIO_SVC_T Service 1323 # define ASIO_SVC_TPARAM1 , typename Service1 1324 # define ASIO_SVC_TPARAM1_DEF1(d1) , typename Service1 d1 1325 # define ASIO_SVC_TPARAM1_DEF2(d1, d2) , typename Service1 d1, d2 1326 # define ASIO_SVC_TARG1 , Service1 1327 # define ASIO_SVC_T1 Service1 1328 # define ASIO_SVC_ACCESS public 1329 #else // defined(ASIO_ENABLE_OLD_SERVICES) 1330 # define ASIO_SVC_TPARAM 1331 # define ASIO_SVC_TPARAM_DEF1(d1) 1332 # define ASIO_SVC_TPARAM_DEF2(d1, d2) 1333 # define ASIO_SVC_TARG 1334 // ASIO_SVC_T is defined at each point of use. 1335 # define ASIO_SVC_TPARAM1 1336 # define ASIO_SVC_TPARAM1_DEF1(d1) 1337 # define ASIO_SVC_TPARAM1_DEF2(d1, d2) 1338 # define ASIO_SVC_TARG1 1339 // ASIO_SVC_T1 is defined at each point of use. 1340 # define ASIO_SVC_ACCESS protected 1341 #endif // defined(ASIO_ENABLE_OLD_SERVICES) 1342 1343 // Helper macros to manage transition away from error_code return values. 1344 #if defined(ASIO_NO_DEPRECATED) 1345 # define ASIO_SYNC_OP_VOID void 1346 # define ASIO_SYNC_OP_VOID_RETURN(e) return 1347 #else // defined(ASIO_NO_DEPRECATED) 1348 # define ASIO_SYNC_OP_VOID asio::error_code 1349 # define ASIO_SYNC_OP_VOID_RETURN(e) return e 1350 #endif // defined(ASIO_NO_DEPRECATED) 1351 1352 // Newer gcc, clang need special treatment to suppress unused typedef warnings. 1353 #if defined(__clang__) && (__clang_major__ >= 7) 1354 # define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) 1355 #elif defined(__GNUC__) 1356 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) 1357 # define ASIO_UNUSED_TYPEDEF __attribute__((__unused__)) 1358 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4) 1359 #endif // defined(__GNUC__) 1360 #if !defined(ASIO_UNUSED_TYPEDEF) 1361 # define ASIO_UNUSED_TYPEDEF 1362 #endif // !defined(ASIO_UNUSED_TYPEDEF) 1363 1364 // Some versions of gcc generate spurious warnings about unused variables. 1365 #if defined(__GNUC__) 1366 # if (__GNUC__ >= 4) 1367 # define ASIO_UNUSED_VARIABLE __attribute__((__unused__)) 1368 # endif // (__GNUC__ >= 4) 1369 #endif // defined(__GNUC__) 1370 #if !defined(ASIO_UNUSED_VARIABLE) 1371 # define ASIO_UNUSED_VARIABLE 1372 #endif // !defined(ASIO_UNUSED_VARIABLE) 1373 1374 #endif // ASIO_DETAIL_CONFIG_HPP 1375