1 // 2 // detail/config.hpp 3 // ~~~~~~~~~~~~~~~~~ 4 // 5 // Copyright (c) 2003-2016 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 # elif defined(ASIO_MSVC) 227 # if (_MSC_VER >= 1900) 228 # define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) 229 # endif // (_MSC_VER >= 1900) 230 # endif // defined(ASIO_MSVC) 231 # if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) 232 # define ASIO_ERROR_CATEGORY_NOEXCEPT 233 # endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) 234 #endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT) 235 236 // Standard library support for arrays. 237 #if !defined(ASIO_HAS_STD_ARRAY) 238 # if !defined(ASIO_DISABLE_STD_ARRAY) 239 # if defined(__clang__) 240 # if defined(ASIO_HAS_CLANG_LIBCXX) 241 # define ASIO_HAS_STD_ARRAY 1 242 # elif (__cplusplus >= 201103) 243 # if __has_include(<array>) 244 # define ASIO_HAS_STD_ARRAY 1 245 # endif // __has_include(<array>) 246 # endif // (__cplusplus >= 201103) 247 # endif // defined(__clang__) 248 # if defined(__GNUC__) 249 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 250 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 251 # define ASIO_HAS_STD_ARRAY 1 252 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 253 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 254 # endif // defined(__GNUC__) 255 # if defined(ASIO_MSVC) 256 # if (_MSC_VER >= 1600) 257 # define ASIO_HAS_STD_ARRAY 1 258 # endif // (_MSC_VER >= 1600) 259 # endif // defined(ASIO_MSVC) 260 # endif // !defined(ASIO_DISABLE_STD_ARRAY) 261 #endif // !defined(ASIO_HAS_STD_ARRAY) 262 263 // Standard library support for shared_ptr and weak_ptr. 264 #if !defined(ASIO_HAS_STD_SHARED_PTR) 265 # if !defined(ASIO_DISABLE_STD_SHARED_PTR) 266 # if defined(__clang__) 267 # if defined(ASIO_HAS_CLANG_LIBCXX) 268 # define ASIO_HAS_STD_SHARED_PTR 1 269 # elif (__cplusplus >= 201103) 270 # define ASIO_HAS_STD_SHARED_PTR 1 271 # endif // (__cplusplus >= 201103) 272 # endif // defined(__clang__) 273 # if defined(__GNUC__) 274 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 275 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 276 # define ASIO_HAS_STD_SHARED_PTR 1 277 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 278 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) 279 # endif // defined(__GNUC__) 280 # if defined(ASIO_MSVC) 281 # if (_MSC_VER >= 1600) 282 # define ASIO_HAS_STD_SHARED_PTR 1 283 # endif // (_MSC_VER >= 1600) 284 # endif // defined(ASIO_MSVC) 285 # endif // !defined(ASIO_DISABLE_STD_SHARED_PTR) 286 #endif // !defined(ASIO_HAS_STD_SHARED_PTR) 287 288 // Standard library support for atomic operations. 289 #if !defined(ASIO_HAS_STD_ATOMIC) 290 # if !defined(ASIO_DISABLE_STD_ATOMIC) 291 # if defined(__clang__) 292 # if defined(ASIO_HAS_CLANG_LIBCXX) 293 # define ASIO_HAS_STD_ATOMIC 1 294 # elif (__cplusplus >= 201103) 295 # if __has_include(<atomic>) 296 # define ASIO_HAS_STD_ATOMIC 1 297 # endif // __has_include(<atomic>) 298 # endif // (__cplusplus >= 201103) 299 # endif // defined(__clang__) 300 # if defined(__GNUC__) 301 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 302 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 303 # define ASIO_HAS_STD_ATOMIC 1 304 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 305 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 306 # endif // defined(__GNUC__) 307 # if defined(ASIO_MSVC) 308 # if (_MSC_VER >= 1700) 309 # define ASIO_HAS_STD_ATOMIC 1 310 # endif // (_MSC_VER >= 1700) 311 # endif // defined(ASIO_MSVC) 312 # endif // !defined(ASIO_DISABLE_STD_ATOMIC) 313 #endif // !defined(ASIO_HAS_STD_ATOMIC) 314 315 // Standard library support for chrono. Some standard libraries (such as the 316 // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x 317 // drafts, rather than the eventually standardised name of steady_clock. 318 #if !defined(ASIO_HAS_STD_CHRONO) 319 # if !defined(ASIO_DISABLE_STD_CHRONO) 320 # if defined(__clang__) 321 # if defined(ASIO_HAS_CLANG_LIBCXX) 322 # define ASIO_HAS_STD_CHRONO 1 323 # elif (__cplusplus >= 201103) 324 # if __has_include(<chrono>) 325 # define ASIO_HAS_STD_CHRONO 1 326 # endif // __has_include(<chrono>) 327 # endif // (__cplusplus >= 201103) 328 # endif // defined(__clang__) 329 # if defined(__GNUC__) 330 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 331 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 332 # define ASIO_HAS_STD_CHRONO 1 333 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) 334 # define ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1 335 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) 336 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 337 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 338 # endif // defined(__GNUC__) 339 # if defined(ASIO_MSVC) 340 # if (_MSC_VER >= 1700) 341 # define ASIO_HAS_STD_CHRONO 1 342 # endif // (_MSC_VER >= 1700) 343 # endif // defined(ASIO_MSVC) 344 # endif // !defined(ASIO_DISABLE_STD_CHRONO) 345 #endif // !defined(ASIO_HAS_STD_CHRONO) 346 347 // Boost support for chrono. 348 #if !defined(ASIO_HAS_BOOST_CHRONO) 349 # if !defined(ASIO_DISABLE_BOOST_CHRONO) 350 # if (BOOST_VERSION >= 104700) 351 # define ASIO_HAS_BOOST_CHRONO 1 352 # endif // (BOOST_VERSION >= 104700) 353 # endif // !defined(ASIO_DISABLE_BOOST_CHRONO) 354 #endif // !defined(ASIO_HAS_BOOST_CHRONO) 355 356 // Boost support for the DateTime library. 357 #if !defined(ASIO_HAS_BOOST_DATE_TIME) 358 # if !defined(ASIO_DISABLE_BOOST_DATE_TIME) 359 # define ASIO_HAS_BOOST_DATE_TIME 1 360 # endif // !defined(ASIO_DISABLE_BOOST_DATE_TIME) 361 #endif // !defined(ASIO_HAS_BOOST_DATE_TIME) 362 363 // Standard library support for addressof. 364 #if !defined(ASIO_HAS_STD_ADDRESSOF) 365 # if !defined(ASIO_DISABLE_STD_ADDRESSOF) 366 # if defined(__clang__) 367 # if defined(ASIO_HAS_CLANG_LIBCXX) 368 # define ASIO_HAS_STD_ADDRESSOF 1 369 # elif (__cplusplus >= 201103) 370 # define ASIO_HAS_STD_ADDRESSOF 1 371 # endif // (__cplusplus >= 201103) 372 # endif // defined(__clang__) 373 # if defined(__GNUC__) 374 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 375 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 376 # define ASIO_HAS_STD_ADDRESSOF 1 377 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 378 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) 379 # endif // defined(__GNUC__) 380 # if defined(ASIO_MSVC) 381 # if (_MSC_VER >= 1700) 382 # define ASIO_HAS_STD_ADDRESSOF 1 383 # endif // (_MSC_VER >= 1700) 384 # endif // defined(ASIO_MSVC) 385 # endif // !defined(ASIO_DISABLE_STD_ADDRESSOF) 386 #endif // !defined(ASIO_HAS_STD_ADDRESSOF) 387 388 // Standard library support for the function class. 389 #if !defined(ASIO_HAS_STD_FUNCTION) 390 # if !defined(ASIO_DISABLE_STD_FUNCTION) 391 # if defined(__clang__) 392 # if defined(ASIO_HAS_CLANG_LIBCXX) 393 # define ASIO_HAS_STD_FUNCTION 1 394 # elif (__cplusplus >= 201103) 395 # define ASIO_HAS_STD_FUNCTION 1 396 # endif // (__cplusplus >= 201103) 397 # endif // defined(__clang__) 398 # if defined(__GNUC__) 399 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 400 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 401 # define ASIO_HAS_STD_FUNCTION 1 402 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 403 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 404 # endif // defined(__GNUC__) 405 # if defined(ASIO_MSVC) 406 # if (_MSC_VER >= 1700) 407 # define ASIO_HAS_STD_FUNCTION 1 408 # endif // (_MSC_VER >= 1700) 409 # endif // defined(ASIO_MSVC) 410 # endif // !defined(ASIO_DISABLE_STD_FUNCTION) 411 #endif // !defined(ASIO_HAS_STD_FUNCTION) 412 413 // Standard library support for type traits. 414 #if !defined(ASIO_HAS_STD_TYPE_TRAITS) 415 # if !defined(ASIO_DISABLE_STD_TYPE_TRAITS) 416 # if defined(__clang__) 417 # if defined(ASIO_HAS_CLANG_LIBCXX) 418 # define ASIO_HAS_STD_TYPE_TRAITS 1 419 # elif (__cplusplus >= 201103) 420 # if __has_include(<type_traits>) 421 # define ASIO_HAS_STD_TYPE_TRAITS 1 422 # endif // __has_include(<type_traits>) 423 # endif // (__cplusplus >= 201103) 424 # endif // defined(__clang__) 425 # if defined(__GNUC__) 426 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 427 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 428 # define ASIO_HAS_STD_TYPE_TRAITS 1 429 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 430 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 431 # endif // defined(__GNUC__) 432 # if defined(ASIO_MSVC) 433 # if (_MSC_VER >= 1700) 434 # define ASIO_HAS_STD_TYPE_TRAITS 1 435 # endif // (_MSC_VER >= 1700) 436 # endif // defined(ASIO_MSVC) 437 # endif // !defined(ASIO_DISABLE_STD_TYPE_TRAITS) 438 #endif // !defined(ASIO_HAS_STD_TYPE_TRAITS) 439 440 // Standard library support for the cstdint header. 441 #if !defined(ASIO_HAS_CSTDINT) 442 # if !defined(ASIO_DISABLE_CSTDINT) 443 # if defined(__clang__) 444 # if defined(ASIO_HAS_CLANG_LIBCXX) 445 # define ASIO_HAS_CSTDINT 1 446 # elif (__cplusplus >= 201103) 447 # define ASIO_HAS_CSTDINT 1 448 # endif // (__cplusplus >= 201103) 449 # endif // defined(__clang__) 450 # if defined(__GNUC__) 451 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 452 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 453 # define ASIO_HAS_CSTDINT 1 454 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 455 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) 456 # endif // defined(__GNUC__) 457 # if defined(ASIO_MSVC) 458 # if (_MSC_VER >= 1700) 459 # define ASIO_HAS_CSTDINT 1 460 # endif // (_MSC_VER >= 1700) 461 # endif // defined(ASIO_MSVC) 462 # endif // !defined(ASIO_DISABLE_CSTDINT) 463 #endif // !defined(ASIO_HAS_CSTDINT) 464 465 // Standard library support for the thread class. 466 #if !defined(ASIO_HAS_STD_THREAD) 467 # if !defined(ASIO_DISABLE_STD_THREAD) 468 # if defined(__clang__) 469 # if defined(ASIO_HAS_CLANG_LIBCXX) 470 # define ASIO_HAS_STD_THREAD 1 471 # elif (__cplusplus >= 201103) 472 # if __has_include(<thread>) 473 # define ASIO_HAS_STD_THREAD 1 474 # endif // __has_include(<thread>) 475 # endif // (__cplusplus >= 201103) 476 # endif // defined(__clang__) 477 # if defined(__GNUC__) 478 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 479 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 480 # define ASIO_HAS_STD_THREAD 1 481 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 482 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 483 # endif // defined(__GNUC__) 484 # if defined(ASIO_MSVC) 485 # if (_MSC_VER >= 1700) 486 # define ASIO_HAS_STD_THREAD 1 487 # endif // (_MSC_VER >= 1700) 488 # endif // defined(ASIO_MSVC) 489 # endif // !defined(ASIO_DISABLE_STD_THREAD) 490 #endif // !defined(ASIO_HAS_STD_THREAD) 491 492 // Standard library support for the mutex and condition variable classes. 493 #if !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 494 # if !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR) 495 # if defined(__clang__) 496 # if defined(ASIO_HAS_CLANG_LIBCXX) 497 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 498 # elif (__cplusplus >= 201103) 499 # if __has_include(<mutex>) 500 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 501 # endif // __has_include(<mutex>) 502 # endif // (__cplusplus >= 201103) 503 # endif // defined(__clang__) 504 # if defined(__GNUC__) 505 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 506 # if defined(__GXX_EXPERIMENTAL_CXX0X__) 507 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 508 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) 509 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) 510 # endif // defined(__GNUC__) 511 # if defined(ASIO_MSVC) 512 # if (_MSC_VER >= 1700) 513 # define ASIO_HAS_STD_MUTEX_AND_CONDVAR 1 514 # endif // (_MSC_VER >= 1700) 515 # endif // defined(ASIO_MSVC) 516 # endif // !defined(ASIO_DISABLE_STD_MUTEX_AND_CONDVAR) 517 #endif // !defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 518 519 // Windows App target. Windows but with a limited API. 520 #if !defined(ASIO_WINDOWS_APP) 521 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603) 522 # include <winapifamily.h> 523 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \ 524 && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 525 # define ASIO_WINDOWS_APP 1 526 # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) 527 // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 528 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603) 529 #endif // !defined(ASIO_WINDOWS_APP) 530 531 // Legacy WinRT target. Windows App is preferred. 532 #if !defined(ASIO_WINDOWS_RUNTIME) 533 # if !defined(ASIO_WINDOWS_APP) 534 # if defined(__cplusplus_winrt) 535 # include <winapifamily.h> 536 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) \ 537 && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 538 # define ASIO_WINDOWS_RUNTIME 1 539 # endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) 540 // && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 541 # endif // defined(__cplusplus_winrt) 542 # endif // !defined(ASIO_WINDOWS_APP) 543 #endif // !defined(ASIO_WINDOWS_RUNTIME) 544 545 // Windows target. Excludes WinRT but includes Windows App targets. 546 #if !defined(ASIO_WINDOWS) 547 # if !defined(ASIO_WINDOWS_RUNTIME) 548 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS) 549 # define ASIO_WINDOWS 1 550 # elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) 551 # define ASIO_WINDOWS 1 552 # elif defined(ASIO_WINDOWS_APP) 553 # define ASIO_WINDOWS 1 554 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS) 555 # endif // !defined(ASIO_WINDOWS_RUNTIME) 556 #endif // !defined(ASIO_WINDOWS) 557 558 // Windows: target OS version. 559 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 560 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS) 561 # if defined(_MSC_VER) || defined(__BORLANDC__) 562 # pragma message( \ 563 "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:\n"\ 564 "- add -D_WIN32_WINNT=0x0501 to the compiler command line; or\n"\ 565 "- add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.\n"\ 566 "Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).") 567 # else // defined(_MSC_VER) || defined(__BORLANDC__) 568 # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. 569 # warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line. 570 # warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). 571 # endif // defined(_MSC_VER) || defined(__BORLANDC__) 572 # define _WIN32_WINNT 0x0501 573 # endif // !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS) 574 # if defined(_MSC_VER) 575 # if defined(_WIN32) && !defined(WIN32) 576 # if !defined(_WINSOCK2API_) 577 # define WIN32 // Needed for correct types in winsock2.h 578 # else // !defined(_WINSOCK2API_) 579 # error Please define the macro WIN32 in your compiler options 580 # endif // !defined(_WINSOCK2API_) 581 # endif // defined(_WIN32) && !defined(WIN32) 582 # endif // defined(_MSC_VER) 583 # if defined(__BORLANDC__) 584 # if defined(__WIN32__) && !defined(WIN32) 585 # if !defined(_WINSOCK2API_) 586 # define WIN32 // Needed for correct types in winsock2.h 587 # else // !defined(_WINSOCK2API_) 588 # error Please define the macro WIN32 in your compiler options 589 # endif // !defined(_WINSOCK2API_) 590 # endif // defined(__WIN32__) && !defined(WIN32) 591 # endif // defined(__BORLANDC__) 592 # if defined(__CYGWIN__) 593 # if !defined(__USE_W32_SOCKETS) 594 # error You must add -D__USE_W32_SOCKETS to your compiler options. 595 # endif // !defined(__USE_W32_SOCKETS) 596 # endif // defined(__CYGWIN__) 597 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 598 599 // Windows: minimise header inclusion. 600 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 601 # if !defined(ASIO_NO_WIN32_LEAN_AND_MEAN) 602 # if !defined(WIN32_LEAN_AND_MEAN) 603 # define WIN32_LEAN_AND_MEAN 604 # endif // !defined(WIN32_LEAN_AND_MEAN) 605 # endif // !defined(ASIO_NO_WIN32_LEAN_AND_MEAN) 606 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 607 608 // Windows: suppress definition of "min" and "max" macros. 609 #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 610 # if !defined(ASIO_NO_NOMINMAX) 611 # if !defined(NOMINMAX) 612 # define NOMINMAX 1 613 # endif // !defined(NOMINMAX) 614 # endif // !defined(ASIO_NO_NOMINMAX) 615 #endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 616 617 // Windows: IO Completion Ports. 618 #if !defined(ASIO_HAS_IOCP) 619 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 620 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400) 621 # if !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) 622 # if !defined(ASIO_DISABLE_IOCP) 623 # define ASIO_HAS_IOCP 1 624 # endif // !defined(ASIO_DISABLE_IOCP) 625 # endif // !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) 626 # endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400) 627 # endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 628 #endif // !defined(ASIO_HAS_IOCP) 629 630 // On POSIX (and POSIX-like) platforms we need to include unistd.h in order to 631 // get access to the various platform feature macros, e.g. to be able to test 632 // for threads support. 633 #if !defined(ASIO_HAS_UNISTD_H) 634 # if !defined(ASIO_HAS_BOOST_CONFIG) 635 # if defined(unix) \ 636 || defined(__unix) \ 637 || defined(_XOPEN_SOURCE) \ 638 || defined(_POSIX_SOURCE) \ 639 || (defined(__MACH__) && defined(__APPLE__)) \ 640 || (defined(__FreeBSD__) || defined(__DragonFly__)) \ 641 || defined(__NetBSD__) \ 642 || defined(__OpenBSD__) \ 643 || defined(__linux__) 644 # define ASIO_HAS_UNISTD_H 1 645 # endif 646 # endif // !defined(ASIO_HAS_BOOST_CONFIG) 647 #endif // !defined(ASIO_HAS_UNISTD_H) 648 #if defined(ASIO_HAS_UNISTD_H) 649 # include <unistd.h> 650 #endif // defined(ASIO_HAS_UNISTD_H) 651 652 // Linux: epoll, eventfd and timerfd. 653 #if defined(__linux__) 654 # include <linux/version.h> 655 # if !defined(ASIO_HAS_EPOLL) 656 # if !defined(ASIO_DISABLE_EPOLL) 657 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45) 658 # define ASIO_HAS_EPOLL 1 659 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45) 660 # endif // !defined(ASIO_DISABLE_EPOLL) 661 # endif // !defined(ASIO_HAS_EPOLL) 662 # if !defined(ASIO_HAS_EVENTFD) 663 # if !defined(ASIO_DISABLE_EVENTFD) 664 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 665 # define ASIO_HAS_EVENTFD 1 666 # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 667 # endif // !defined(ASIO_DISABLE_EVENTFD) 668 # endif // !defined(ASIO_HAS_EVENTFD) 669 # if !defined(ASIO_HAS_TIMERFD) 670 # if defined(ASIO_HAS_EPOLL) 671 # if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) 672 # define ASIO_HAS_TIMERFD 1 673 # endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) 674 # endif // defined(ASIO_HAS_EPOLL) 675 # endif // !defined(ASIO_HAS_TIMERFD) 676 #endif // defined(__linux__) 677 678 // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue. 679 #if (defined(__MACH__) && defined(__APPLE__)) \ 680 || (defined(__FreeBSD__) || defined(__DragonFly__)) \ 681 || defined(__NetBSD__) \ 682 || defined(__OpenBSD__) 683 # if !defined(ASIO_HAS_KQUEUE) 684 # if !defined(ASIO_DISABLE_KQUEUE) 685 # define ASIO_HAS_KQUEUE 1 686 # endif // !defined(ASIO_DISABLE_KQUEUE) 687 # endif // !defined(ASIO_HAS_KQUEUE) 688 #endif // (defined(__MACH__) && defined(__APPLE__)) 689 // || (defined(__FreeBSD__) || defined(__DragonFly__)) 690 // || defined(__NetBSD__) 691 // || defined(__OpenBSD__) 692 693 // Solaris: /dev/poll. 694 #if defined(__sun) 695 # if !defined(ASIO_HAS_DEV_POLL) 696 # if !defined(ASIO_DISABLE_DEV_POLL) 697 # define ASIO_HAS_DEV_POLL 1 698 # endif // !defined(ASIO_DISABLE_DEV_POLL) 699 # endif // !defined(ASIO_HAS_DEV_POLL) 700 #endif // defined(__sun) 701 702 // Serial ports. 703 #if !defined(ASIO_HAS_SERIAL_PORT) 704 # if defined(ASIO_HAS_IOCP) \ 705 || !defined(ASIO_WINDOWS) \ 706 && !defined(ASIO_WINDOWS_RUNTIME) \ 707 && !defined(__CYGWIN__) 708 # if !defined(__SYMBIAN32__) 709 # if !defined(ASIO_DISABLE_SERIAL_PORT) 710 # define ASIO_HAS_SERIAL_PORT 1 711 # endif // !defined(ASIO_DISABLE_SERIAL_PORT) 712 # endif // !defined(__SYMBIAN32__) 713 # endif // defined(ASIO_HAS_IOCP) 714 // || !defined(ASIO_WINDOWS) 715 // && !defined(ASIO_WINDOWS_RUNTIME) 716 // && !defined(__CYGWIN__) 717 #endif // !defined(ASIO_HAS_SERIAL_PORT) 718 719 // Windows: stream handles. 720 #if !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) 721 # if !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE) 722 # if defined(ASIO_HAS_IOCP) 723 # define ASIO_HAS_WINDOWS_STREAM_HANDLE 1 724 # endif // defined(ASIO_HAS_IOCP) 725 # endif // !defined(ASIO_DISABLE_WINDOWS_STREAM_HANDLE) 726 #endif // !defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) 727 728 // Windows: random access handles. 729 #if !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) 730 # if !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE) 731 # if defined(ASIO_HAS_IOCP) 732 # define ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1 733 # endif // defined(ASIO_HAS_IOCP) 734 # endif // !defined(ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE) 735 #endif // !defined(ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE) 736 737 // Windows: object handles. 738 #if !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) 739 # if !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE) 740 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 741 # if !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) 742 # define ASIO_HAS_WINDOWS_OBJECT_HANDLE 1 743 # endif // !defined(UNDER_CE) && !defined(ASIO_WINDOWS_APP) 744 # endif // defined(ASIO_WINDOWS) || defined(__CYGWIN__) 745 # endif // !defined(ASIO_DISABLE_WINDOWS_OBJECT_HANDLE) 746 #endif // !defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) 747 748 // Windows: OVERLAPPED wrapper. 749 #if !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) 750 # if !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR) 751 # if defined(ASIO_HAS_IOCP) 752 # define ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1 753 # endif // defined(ASIO_HAS_IOCP) 754 # endif // !defined(ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR) 755 #endif // !defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) 756 757 // POSIX: stream-oriented file descriptors. 758 #if !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) 759 # if !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) 760 # if !defined(ASIO_WINDOWS) \ 761 && !defined(ASIO_WINDOWS_RUNTIME) \ 762 && !defined(__CYGWIN__) 763 # define ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1 764 # endif // !defined(ASIO_WINDOWS) 765 // && !defined(ASIO_WINDOWS_RUNTIME) 766 // && !defined(__CYGWIN__) 767 # endif // !defined(ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) 768 #endif // !defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) 769 770 // UNIX domain sockets. 771 #if !defined(ASIO_HAS_LOCAL_SOCKETS) 772 # if !defined(ASIO_DISABLE_LOCAL_SOCKETS) 773 # if !defined(ASIO_WINDOWS) \ 774 && !defined(ASIO_WINDOWS_RUNTIME) \ 775 && !defined(__CYGWIN__) 776 # define ASIO_HAS_LOCAL_SOCKETS 1 777 # endif // !defined(ASIO_WINDOWS) 778 // && !defined(ASIO_WINDOWS_RUNTIME) 779 // && !defined(__CYGWIN__) 780 # endif // !defined(ASIO_DISABLE_LOCAL_SOCKETS) 781 #endif // !defined(ASIO_HAS_LOCAL_SOCKETS) 782 783 // Can use sigaction() instead of signal(). 784 #if !defined(ASIO_HAS_SIGACTION) 785 # if !defined(ASIO_DISABLE_SIGACTION) 786 # if !defined(ASIO_WINDOWS) \ 787 && !defined(ASIO_WINDOWS_RUNTIME) \ 788 && !defined(__CYGWIN__) 789 # define ASIO_HAS_SIGACTION 1 790 # endif // !defined(ASIO_WINDOWS) 791 // && !defined(ASIO_WINDOWS_RUNTIME) 792 // && !defined(__CYGWIN__) 793 # endif // !defined(ASIO_DISABLE_SIGACTION) 794 #endif // !defined(ASIO_HAS_SIGACTION) 795 796 // Can use signal(). 797 #if !defined(ASIO_HAS_SIGNAL) 798 # if !defined(ASIO_DISABLE_SIGNAL) 799 # if !defined(UNDER_CE) 800 # define ASIO_HAS_SIGNAL 1 801 # endif // !defined(UNDER_CE) 802 # endif // !defined(ASIO_DISABLE_SIGNAL) 803 #endif // !defined(ASIO_HAS_SIGNAL) 804 805 // Can use getaddrinfo() and getnameinfo(). 806 #if !defined(ASIO_HAS_GETADDRINFO) 807 # if !defined(ASIO_DISABLE_GETADDRINFO) 808 # if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 809 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) 810 # define ASIO_HAS_GETADDRINFO 1 811 # elif defined(UNDER_CE) 812 # define ASIO_HAS_GETADDRINFO 1 813 # endif // defined(UNDER_CE) 814 # elif defined(__MACH__) && defined(__APPLE__) 815 # if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 816 # if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) 817 # define ASIO_HAS_GETADDRINFO 1 818 # endif // (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) 819 # else // defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 820 # define ASIO_HAS_GETADDRINFO 1 821 # endif // defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 822 # else // defined(__MACH__) && defined(__APPLE__) 823 # define ASIO_HAS_GETADDRINFO 1 824 # endif // defined(__MACH__) && defined(__APPLE__) 825 # endif // !defined(ASIO_DISABLE_GETADDRINFO) 826 #endif // !defined(ASIO_HAS_GETADDRINFO) 827 828 // Whether standard iostreams are disabled. 829 #if !defined(ASIO_NO_IOSTREAM) 830 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM) 831 # define ASIO_NO_IOSTREAM 1 832 # endif // !defined(BOOST_NO_IOSTREAM) 833 #endif // !defined(ASIO_NO_IOSTREAM) 834 835 // Whether exception handling is disabled. 836 #if !defined(ASIO_NO_EXCEPTIONS) 837 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS) 838 # define ASIO_NO_EXCEPTIONS 1 839 # endif // !defined(BOOST_NO_EXCEPTIONS) 840 #endif // !defined(ASIO_NO_EXCEPTIONS) 841 842 // Whether the typeid operator is supported. 843 #if !defined(ASIO_NO_TYPEID) 844 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID) 845 # define ASIO_NO_TYPEID 1 846 # endif // !defined(BOOST_NO_TYPEID) 847 #endif // !defined(ASIO_NO_TYPEID) 848 849 // Threads. 850 #if !defined(ASIO_HAS_THREADS) 851 # if !defined(ASIO_DISABLE_THREADS) 852 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS) 853 # define ASIO_HAS_THREADS 1 854 # elif defined(_MSC_VER) && defined(_MT) 855 # define ASIO_HAS_THREADS 1 856 # elif defined(__BORLANDC__) && defined(__MT__) 857 # define ASIO_HAS_THREADS 1 858 # elif defined(_POSIX_THREADS) 859 # define ASIO_HAS_THREADS 1 860 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS) 861 # endif // !defined(ASIO_DISABLE_THREADS) 862 #endif // !defined(ASIO_HAS_THREADS) 863 864 // POSIX threads. 865 #if !defined(ASIO_HAS_PTHREADS) 866 # if defined(ASIO_HAS_THREADS) 867 # if defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS) 868 # define ASIO_HAS_PTHREADS 1 869 # elif defined(_POSIX_THREADS) 870 # define ASIO_HAS_PTHREADS 1 871 # endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS) 872 # endif // defined(ASIO_HAS_THREADS) 873 #endif // !defined(ASIO_HAS_PTHREADS) 874 875 // Helper to prevent macro expansion. 876 #define ASIO_PREVENT_MACRO_SUBSTITUTION 877 878 // Helper to define in-class constants. 879 #if !defined(ASIO_STATIC_CONSTANT) 880 # if !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) 881 # define ASIO_STATIC_CONSTANT(type, assignment) \ 882 BOOST_STATIC_CONSTANT(type, assignment) 883 # else // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) 884 # define ASIO_STATIC_CONSTANT(type, assignment) \ 885 static const type assignment 886 # endif // !defined(ASIO_DISABLE_BOOST_STATIC_CONSTANT) 887 #endif // !defined(ASIO_STATIC_CONSTANT) 888 889 // Boost array library. 890 #if !defined(ASIO_HAS_BOOST_ARRAY) 891 # if !defined(ASIO_DISABLE_BOOST_ARRAY) 892 # define ASIO_HAS_BOOST_ARRAY 1 893 # endif // !defined(ASIO_DISABLE_BOOST_ARRAY) 894 #endif // !defined(ASIO_HAS_BOOST_ARRAY) 895 896 // Boost assert macro. 897 #if !defined(ASIO_HAS_BOOST_ASSERT) 898 # if !defined(ASIO_DISABLE_BOOST_ASSERT) 899 # define ASIO_HAS_BOOST_ASSERT 1 900 # endif // !defined(ASIO_DISABLE_BOOST_ASSERT) 901 #endif // !defined(ASIO_HAS_BOOST_ASSERT) 902 903 // Boost limits header. 904 #if !defined(ASIO_HAS_BOOST_LIMITS) 905 # if !defined(ASIO_DISABLE_BOOST_LIMITS) 906 # define ASIO_HAS_BOOST_LIMITS 1 907 # endif // !defined(ASIO_DISABLE_BOOST_LIMITS) 908 #endif // !defined(ASIO_HAS_BOOST_LIMITS) 909 910 // Boost throw_exception function. 911 #if !defined(ASIO_HAS_BOOST_THROW_EXCEPTION) 912 # if !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION) 913 # define ASIO_HAS_BOOST_THROW_EXCEPTION 1 914 # endif // !defined(ASIO_DISABLE_BOOST_THROW_EXCEPTION) 915 #endif // !defined(ASIO_HAS_BOOST_THROW_EXCEPTION) 916 917 // Boost regex library. 918 #if !defined(ASIO_HAS_BOOST_REGEX) 919 # if !defined(ASIO_DISABLE_BOOST_REGEX) 920 # define ASIO_HAS_BOOST_REGEX 1 921 # endif // !defined(ASIO_DISABLE_BOOST_REGEX) 922 #endif // !defined(ASIO_HAS_BOOST_REGEX) 923 924 // Boost bind function. 925 #if !defined(ASIO_HAS_BOOST_BIND) 926 # if !defined(ASIO_DISABLE_BOOST_BIND) 927 # define ASIO_HAS_BOOST_BIND 1 928 # endif // !defined(ASIO_DISABLE_BOOST_BIND) 929 #endif // !defined(ASIO_HAS_BOOST_BIND) 930 931 // Boost's BOOST_WORKAROUND macro. 932 #if !defined(ASIO_HAS_BOOST_WORKAROUND) 933 # if !defined(ASIO_DISABLE_BOOST_WORKAROUND) 934 # define ASIO_HAS_BOOST_WORKAROUND 1 935 # endif // !defined(ASIO_DISABLE_BOOST_WORKAROUND) 936 #endif // !defined(ASIO_HAS_BOOST_WORKAROUND) 937 938 // Microsoft Visual C++'s secure C runtime library. 939 #if !defined(ASIO_HAS_SECURE_RTL) 940 # if !defined(ASIO_DISABLE_SECURE_RTL) 941 # if defined(ASIO_MSVC) \ 942 && (ASIO_MSVC >= 1400) \ 943 && !defined(UNDER_CE) 944 # define ASIO_HAS_SECURE_RTL 1 945 # endif // defined(ASIO_MSVC) 946 // && (ASIO_MSVC >= 1400) 947 // && !defined(UNDER_CE) 948 # endif // !defined(ASIO_DISABLE_SECURE_RTL) 949 #endif // !defined(ASIO_HAS_SECURE_RTL) 950 951 // Handler hooking. Disabled for ancient Borland C++ and gcc compilers. 952 #if !defined(ASIO_HAS_HANDLER_HOOKS) 953 # if !defined(ASIO_DISABLE_HANDLER_HOOKS) 954 # if defined(__GNUC__) 955 # if (__GNUC__ >= 3) 956 # define ASIO_HAS_HANDLER_HOOKS 1 957 # endif // (__GNUC__ >= 3) 958 # elif !defined(__BORLANDC__) 959 # define ASIO_HAS_HANDLER_HOOKS 1 960 # endif // !defined(__BORLANDC__) 961 # endif // !defined(ASIO_DISABLE_HANDLER_HOOKS) 962 #endif // !defined(ASIO_HAS_HANDLER_HOOKS) 963 964 // Support for the __thread keyword extension. 965 #if !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) 966 # if defined(__linux__) 967 # if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 968 # if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3) 969 # if !defined(__INTEL_COMPILER) && !defined(__ICL) 970 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 971 # define ASIO_THREAD_KEYWORD __thread 972 # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100) 973 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 974 # endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100) 975 # endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3) 976 # endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 977 # endif // defined(__linux__) 978 # if defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME) 979 # if (_MSC_VER >= 1700) 980 # define ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 981 # define ASIO_THREAD_KEYWORD __declspec(thread) 982 # endif // (_MSC_VER >= 1700) 983 # endif // defined(ASIO_MSVC) && defined(ASIO_WINDOWS_RUNTIME) 984 #endif // !defined(ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) 985 #if !defined(ASIO_THREAD_KEYWORD) 986 # define ASIO_THREAD_KEYWORD __thread 987 #endif // !defined(ASIO_THREAD_KEYWORD) 988 989 // Support for POSIX ssize_t typedef. 990 #if !defined(ASIO_DISABLE_SSIZE_T) 991 # if defined(__linux__) \ 992 || (defined(__MACH__) && defined(__APPLE__)) 993 # define ASIO_HAS_SSIZE_T 1 994 # endif // defined(__linux__) 995 // || (defined(__MACH__) && defined(__APPLE__)) 996 #endif // !defined(ASIO_DISABLE_SSIZE_T) 997 998 #endif // ASIO_DETAIL_CONFIG_HPP 999