config.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED
  2. #define BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED
  3. // Copyright 2018-2022 Peter Dimov
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // See http://www.boost.org/libs/system for documentation.
  9. #include <boost/system/detail/requires_cxx11.hpp>
  10. #include <boost/config.hpp>
  11. #include <boost/config/workaround.hpp>
  12. // BOOST_SYSTEM_HAS_SYSTEM_ERROR
  13. //
  14. // The macro BOOST_SYSTEM_DISABLE_THREADS can be defined on configurations
  15. // that provide <system_error> and <atomic>, but not <mutex>, such as the
  16. // single-threaded libstdc++.
  17. //
  18. // https://github.com/boostorg/system/issues/92
  19. #if !defined(BOOST_NO_CXX11_HDR_SYSTEM_ERROR) && !defined(BOOST_NO_CXX11_HDR_ATOMIC) && ( !defined(BOOST_NO_CXX11_HDR_MUTEX) || defined(BOOST_SYSTEM_DISABLE_THREADS) )
  20. # define BOOST_SYSTEM_HAS_SYSTEM_ERROR
  21. #endif
  22. // BOOST_SYSTEM_NOEXCEPT
  23. // Retained for backward compatibility
  24. #define BOOST_SYSTEM_NOEXCEPT BOOST_NOEXCEPT
  25. // BOOST_SYSTEM_HAS_CONSTEXPR
  26. #if !defined(BOOST_NO_CXX14_CONSTEXPR)
  27. # define BOOST_SYSTEM_HAS_CONSTEXPR
  28. #endif
  29. #if BOOST_WORKAROUND(BOOST_GCC, < 60000)
  30. # undef BOOST_SYSTEM_HAS_CONSTEXPR
  31. #endif
  32. #if defined(BOOST_SYSTEM_HAS_CONSTEXPR)
  33. # define BOOST_SYSTEM_CONSTEXPR constexpr
  34. #else
  35. # define BOOST_SYSTEM_CONSTEXPR
  36. #endif
  37. // BOOST_SYSTEM_DEPRECATED
  38. #if defined(__clang__)
  39. # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg)))
  40. #elif defined(__GNUC__)
  41. # if __GNUC__ * 100 + __GNUC_MINOR__ >= 405
  42. # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg)))
  43. # else
  44. # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated))
  45. # endif
  46. #elif defined(_MSC_VER)
  47. # define BOOST_SYSTEM_DEPRECATED(msg) __declspec(deprecated(msg))
  48. #elif defined(__sun)
  49. # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg)))
  50. #else
  51. # define BOOST_SYSTEM_DEPRECATED(msg)
  52. #endif
  53. // BOOST_SYSTEM_CLANG_6
  54. // Android NDK r18b has Clang 7.0.2 that still needs the workaround
  55. // https://github.com/boostorg/system/issues/100
  56. #if defined(__clang__) && (__clang_major__ < 7 || (defined(__APPLE__) && __clang_major__ < 11) || (defined(__ANDROID__) && __clang_major__ == 7))
  57. # define BOOST_SYSTEM_CLANG_6
  58. #endif
  59. //
  60. #if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000
  61. # define BOOST_SYSTEM_AVOID_STD_GENERIC_CATEGORY
  62. #endif
  63. #if defined(__CYGWIN__) || defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER == 1800) || (defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 90000)
  64. // Under Cygwin (and MinGW!), std::system_category() is POSIX
  65. // Under VS2013, std::system_category() isn't quite right
  66. // Under libstdc++ before 7.4, before 8.3, before 9.1, default_error_condition
  67. // for the system category returns a condition from the system category
  68. # define BOOST_SYSTEM_AVOID_STD_SYSTEM_CATEGORY
  69. #endif
  70. #endif // BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED