config.hpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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/config.hpp>
  10. #include <boost/config/workaround.hpp>
  11. // The macro BOOST_SYSTEM_DISABLE_THREADS can be defined on configurations
  12. // that provide <system_error> and <atomic>, but not <mutex>, such as the
  13. // single-threaded libstdc++.
  14. //
  15. // https://github.com/boostorg/system/issues/92
  16. // BOOST_SYSTEM_NOEXCEPT
  17. // Retained for backward compatibility
  18. #define BOOST_SYSTEM_NOEXCEPT noexcept
  19. // BOOST_SYSTEM_HAS_CONSTEXPR
  20. #if !defined(BOOST_NO_CXX14_CONSTEXPR)
  21. # define BOOST_SYSTEM_HAS_CONSTEXPR
  22. #endif
  23. #if BOOST_WORKAROUND(BOOST_GCC, < 60000)
  24. # undef BOOST_SYSTEM_HAS_CONSTEXPR
  25. #endif
  26. #if defined(BOOST_SYSTEM_HAS_CONSTEXPR)
  27. # define BOOST_SYSTEM_CONSTEXPR constexpr
  28. #else
  29. # define BOOST_SYSTEM_CONSTEXPR
  30. #endif
  31. // BOOST_SYSTEM_DEPRECATED
  32. #if defined(__clang__)
  33. # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg)))
  34. #elif defined(__GNUC__)
  35. # if __GNUC__ * 100 + __GNUC_MINOR__ >= 405
  36. # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg)))
  37. # else
  38. # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated))
  39. # endif
  40. #elif defined(_MSC_VER)
  41. # define BOOST_SYSTEM_DEPRECATED(msg) __declspec(deprecated(msg))
  42. #elif defined(__sun)
  43. # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg)))
  44. #else
  45. # define BOOST_SYSTEM_DEPRECATED(msg)
  46. #endif
  47. // BOOST_SYSTEM_CLANG_6
  48. // Android NDK r18b has Clang 7.0.2 that still needs the workaround
  49. // https://github.com/boostorg/system/issues/100
  50. #if defined(__clang__) && (__clang_major__ < 7 || (defined(__APPLE__) && __clang_major__ < 11) || (defined(__ANDROID__) && __clang_major__ == 7))
  51. # define BOOST_SYSTEM_CLANG_6
  52. #endif
  53. //
  54. #if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000
  55. # define BOOST_SYSTEM_AVOID_STD_GENERIC_CATEGORY
  56. #endif
  57. #if defined(__CYGWIN__) || defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER == 1800) || (defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 90000)
  58. // Under Cygwin (and MinGW!), std::system_category() is POSIX
  59. // Under VS2013, std::system_category() isn't quite right
  60. // Under libstdc++ before 7.4, before 8.3, before 9.1, default_error_condition
  61. // for the system category returns a condition from the system category
  62. # define BOOST_SYSTEM_AVOID_STD_SYSTEM_CATEGORY
  63. #endif
  64. #endif // BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED