| 1 | #ifndef BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED |
| 2 | #define BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED |
| 3 | |
| 4 | // Copyright 2018-2022 Peter Dimov |
| 5 | // |
| 6 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 7 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 8 | // |
| 9 | // See http://www.boost.org/libs/system for documentation. |
| 10 | |
| 11 | #include <boost/config.hpp> |
| 12 | #include <boost/config/workaround.hpp> |
| 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 | |
| 20 | // BOOST_SYSTEM_NOEXCEPT |
| 21 | // Retained for backward compatibility |
| 22 | |
| 23 | #define BOOST_SYSTEM_NOEXCEPT noexcept |
| 24 | |
| 25 | // BOOST_SYSTEM_HAS_CONSTEXPR |
| 26 | |
| 27 | #if !defined(BOOST_NO_CXX14_CONSTEXPR) |
| 28 | # define BOOST_SYSTEM_HAS_CONSTEXPR |
| 29 | #endif |
| 30 | |
| 31 | #if BOOST_WORKAROUND(BOOST_GCC, < 60000) |
| 32 | # undef BOOST_SYSTEM_HAS_CONSTEXPR |
| 33 | #endif |
| 34 | |
| 35 | #if defined(BOOST_SYSTEM_HAS_CONSTEXPR) |
| 36 | # define BOOST_SYSTEM_CONSTEXPR constexpr |
| 37 | #else |
| 38 | # define BOOST_SYSTEM_CONSTEXPR |
| 39 | #endif |
| 40 | |
| 41 | // BOOST_SYSTEM_DEPRECATED |
| 42 | |
| 43 | #if defined(__clang__) |
| 44 | # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg))) |
| 45 | #elif defined(__GNUC__) |
| 46 | # if __GNUC__ * 100 + __GNUC_MINOR__ >= 405 |
| 47 | # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg))) |
| 48 | # else |
| 49 | # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated)) |
| 50 | # endif |
| 51 | #elif defined(_MSC_VER) |
| 52 | # define BOOST_SYSTEM_DEPRECATED(msg) __declspec(deprecated(msg)) |
| 53 | #elif defined(__sun) |
| 54 | # define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg))) |
| 55 | #else |
| 56 | # define BOOST_SYSTEM_DEPRECATED(msg) |
| 57 | #endif |
| 58 | |
| 59 | // BOOST_SYSTEM_CLANG_6 |
| 60 | |
| 61 | // Android NDK r18b has Clang 7.0.2 that still needs the workaround |
| 62 | // https://github.com/boostorg/system/issues/100 |
| 63 | #if defined(__clang__) && (__clang_major__ < 7 || (defined(__APPLE__) && __clang_major__ < 11) || (defined(__ANDROID__) && __clang_major__ == 7)) |
| 64 | # define BOOST_SYSTEM_CLANG_6 |
| 65 | #endif |
| 66 | |
| 67 | // |
| 68 | |
| 69 | #if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000 |
| 70 | # define BOOST_SYSTEM_AVOID_STD_GENERIC_CATEGORY |
| 71 | #endif |
| 72 | |
| 73 | #if defined(__CYGWIN__) || defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER == 1800) || (defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 90000) |
| 74 | |
| 75 | // Under Cygwin (and MinGW!), std::system_category() is POSIX |
| 76 | // Under VS2013, std::system_category() isn't quite right |
| 77 | // Under libstdc++ before 7.4, before 8.3, before 9.1, default_error_condition |
| 78 | // for the system category returns a condition from the system category |
| 79 | |
| 80 | # define BOOST_SYSTEM_AVOID_STD_SYSTEM_CATEGORY |
| 81 | #endif |
| 82 | |
| 83 | #endif // BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED |
| 84 | |