config.hpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/beast
  8. //
  9. #ifndef BOOST_BEAST_CORE_DETAIL_CONFIG_HPP
  10. #define BOOST_BEAST_CORE_DETAIL_CONFIG_HPP
  11. // Available to every header
  12. #include <boost/config.hpp>
  13. #include <boost/version.hpp>
  14. #include <boost/core/ignore_unused.hpp>
  15. #include <boost/static_assert.hpp>
  16. namespace boost {
  17. namespace asio
  18. {
  19. } // asio
  20. namespace beast {
  21. namespace net = boost::asio;
  22. } // beast
  23. } // boost
  24. /*
  25. _MSC_VER and _MSC_FULL_VER by version:
  26. 14.0 (2015) 1900 190023026
  27. 14.0 (2015 Update 1) 1900 190023506
  28. 14.0 (2015 Update 2) 1900 190023918
  29. 14.0 (2015 Update 3) 1900 190024210
  30. */
  31. #if defined(BOOST_MSVC)
  32. # if BOOST_MSVC_FULL_VER < 190024210
  33. # error Beast requires C++11: Visual Studio 2015 Update 3 or later needed
  34. # endif
  35. #elif defined(BOOST_GCC)
  36. # if(BOOST_GCC < 40801)
  37. # error Beast requires C++11: gcc version 4.8 or later needed
  38. # endif
  39. #else
  40. # if \
  41. defined(BOOST_NO_CXX11_DECLTYPE) || \
  42. defined(BOOST_NO_CXX11_HDR_TUPLE) || \
  43. defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) || \
  44. defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
  45. # error Beast requires C++11: a conforming compiler is needed
  46. # endif
  47. #endif
  48. #define BOOST_BEAST_DEPRECATION_STRING \
  49. "This is a deprecated interface, #define BOOST_BEAST_ALLOW_DEPRECATED to allow it"
  50. #ifndef BOOST_BEAST_ASSUME
  51. # ifdef BOOST_GCC
  52. # define BOOST_BEAST_ASSUME(cond) \
  53. do { if (!(cond)) __builtin_unreachable(); } while (0)
  54. # else
  55. # define BOOST_BEAST_ASSUME(cond) do { } while(0)
  56. # endif
  57. #endif
  58. // Default to a header-only implementation. The user must specifically
  59. // request separate compilation by defining BOOST_BEAST_SEPARATE_COMPILATION
  60. #ifndef BOOST_BEAST_HEADER_ONLY
  61. # ifndef BOOST_BEAST_SEPARATE_COMPILATION
  62. # define BOOST_BEAST_HEADER_ONLY 1
  63. # endif
  64. #endif
  65. #if BOOST_BEAST_DOXYGEN
  66. # define BOOST_BEAST_DECL
  67. #elif defined(BOOST_BEAST_HEADER_ONLY)
  68. # define BOOST_BEAST_DECL inline
  69. #else
  70. # define BOOST_BEAST_DECL
  71. #endif
  72. #ifndef BOOST_BEAST_ASYNC_RESULT1
  73. #define BOOST_BEAST_ASYNC_RESULT1(type) \
  74. BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(type, void(::boost::beast::error_code))
  75. #endif
  76. #ifndef BOOST_BEAST_ASYNC_RESULT2
  77. #define BOOST_BEAST_ASYNC_RESULT2(type) \
  78. BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(type, void(::boost::beast::error_code, ::std::size_t))
  79. #endif
  80. #ifndef BOOST_BEAST_ASYNC_TPARAM1
  81. #define BOOST_BEAST_ASYNC_TPARAM1 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code))
  82. #endif
  83. #ifndef BOOST_BEAST_ASYNC_TPARAM2
  84. #define BOOST_BEAST_ASYNC_TPARAM2 BOOST_ASIO_COMPLETION_TOKEN_FOR(void(::boost::beast::error_code, ::std::size_t))
  85. #endif
  86. #endif