diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-12-29 10:21:25 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-12-29 10:21:25 +0300 |
commit | 7f4b65c31a07232e7c512cfd6fa581d8ccc3a592 (patch) | |
tree | 0b6e56ea1be5118bfcc299cd4e59b457ea5ff7d8 /contrib | |
parent | 05444d93a739253c1f9568931ffb94daa3527805 (diff) | |
download | ydb-7f4b65c31a07232e7c512cfd6fa581d8ccc3a592.tar.gz |
Update contrib/restricted/boost/system to 1.81.0
Diffstat (limited to 'contrib')
5 files changed, 109 insertions, 47 deletions
diff --git a/contrib/restricted/boost/system/include/boost/system/detail/config.hpp b/contrib/restricted/boost/system/include/boost/system/detail/config.hpp index ad958bcabe..2dbb2f99ba 100644 --- a/contrib/restricted/boost/system/include/boost/system/detail/config.hpp +++ b/contrib/restricted/boost/system/include/boost/system/detail/config.hpp @@ -12,8 +12,14 @@ #include <boost/config/workaround.hpp> // BOOST_SYSTEM_HAS_SYSTEM_ERROR +// +// The macro BOOST_SYSTEM_DISABLE_THREADS can be defined on configurations +// that provide <system_error> and <atomic>, but not <mutex>, such as the +// single-threaded libstdc++. +// +// https://github.com/boostorg/system/issues/92 -#if !defined(BOOST_NO_CXX11_HDR_SYSTEM_ERROR) && !defined(BOOST_NO_CXX11_HDR_ATOMIC) && !defined(BOOST_NO_CXX11_HDR_MUTEX) +#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) ) # define BOOST_SYSTEM_HAS_SYSTEM_ERROR #endif diff --git a/contrib/restricted/boost/system/include/boost/system/detail/error_category.hpp b/contrib/restricted/boost/system/include/boost/system/detail/error_category.hpp index 6185423eda..40b65f431d 100644 --- a/contrib/restricted/boost/system/include/boost/system/detail/error_category.hpp +++ b/contrib/restricted/boost/system/include/boost/system/detail/error_category.hpp @@ -48,7 +48,7 @@ class std_category; #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #endif -#if defined(BOOST_MSVC) +#if defined(BOOST_MSVC) && BOOST_MSVC < 1900 #pragma warning(push) #pragma warning(disable: 4351) // new behavior: elements of array will be default initialized #endif @@ -183,7 +183,7 @@ public: #endif }; -#if defined(BOOST_MSVC) +#if defined(BOOST_MSVC) && BOOST_MSVC < 1900 #pragma warning(pop) #endif diff --git a/contrib/restricted/boost/system/include/boost/system/detail/error_category_impl.hpp b/contrib/restricted/boost/system/include/boost/system/detail/error_category_impl.hpp index 982c667b3f..904a3a6cb6 100644 --- a/contrib/restricted/boost/system/include/boost/system/detail/error_category_impl.hpp +++ b/contrib/restricted/boost/system/include/boost/system/detail/error_category_impl.hpp @@ -98,14 +98,19 @@ inline char const * error_category::message( int ev, char * buffer, std::size_t #if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) #include <boost/system/detail/std_category_impl.hpp> -#include <mutex> #include <new> +#if !defined(BOOST_SYSTEM_DISABLE_THREADS) +# include <mutex> +#endif + namespace boost { namespace system { +#if !defined(BOOST_SYSTEM_DISABLE_THREADS) + namespace detail { @@ -118,6 +123,8 @@ template<class T> std::mutex stdcat_mx_holder<T>::mx_; } // namespace detail +#endif + inline void error_category::init_stdcat() const { static_assert( sizeof( stdcat_ ) >= sizeof( boost::system::detail::std_category ), "sizeof(stdcat_) is not enough for std_category" ); @@ -130,7 +137,9 @@ inline void error_category::init_stdcat() const #endif +#if !defined(BOOST_SYSTEM_DISABLE_THREADS) std::lock_guard<std::mutex> lk( boost::system::detail::stdcat_mx_holder<>::mx_ ); +#endif if( sc_init_.load( std::memory_order_acquire ) == 0 ) { diff --git a/contrib/restricted/boost/system/include/boost/system/detail/error_code.hpp b/contrib/restricted/boost/system/include/boost/system/detail/error_code.hpp index 584b4b3487..1189fb4490 100644 --- a/contrib/restricted/boost/system/include/boost/system/detail/error_code.hpp +++ b/contrib/restricted/boost/system/include/boost/system/detail/error_code.hpp @@ -29,6 +29,7 @@ #include <boost/assert/source_location.hpp> #include <boost/cstdint.hpp> #include <boost/config.hpp> +#include <boost/config/workaround.hpp> #include <ostream> #include <new> #include <cstdio> @@ -57,12 +58,14 @@ namespace system // and error_code containing a pointer to an object of a type derived // from error_category. +bool operator==( const error_code & code, const error_condition & condition ) BOOST_NOEXCEPT; std::size_t hash_value( error_code const & ec ); class error_code { private: + friend bool operator==( const error_code & code, const error_condition & condition ) BOOST_NOEXCEPT; friend std::size_t hash_value( error_code const & ec ); private: @@ -114,7 +117,10 @@ public: // constructors: - BOOST_SYSTEM_CONSTEXPR error_code() BOOST_NOEXCEPT: +#if !BOOST_WORKAROUND(BOOST_GCC, < 40800) + BOOST_CONSTEXPR +#endif + error_code() BOOST_NOEXCEPT: d1_(), lc_flags_( 0 ) { } @@ -434,48 +440,6 @@ public: return !( lhs == rhs ); } - inline friend bool operator==( const error_code & code, const error_condition & condition ) BOOST_NOEXCEPT - { -#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) - - if( code.lc_flags_ == 1 ) - { - return static_cast<std::error_code>( code ) == static_cast<std::error_condition>( condition ); - } - else - -#endif - { - return code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() ); - } - } - - inline friend bool operator==( const error_condition & condition, const error_code & code ) BOOST_NOEXCEPT - { -#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) - - if( code.lc_flags_ == 1 ) - { - return static_cast<std::error_code>( code ) == static_cast<std::error_condition>( condition ); - } - else - -#endif - { - return code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() ); - } - } - - inline friend bool operator!=( const error_code & lhs, const error_condition & rhs ) BOOST_NOEXCEPT - { - return !( lhs == rhs ); - } - - inline friend bool operator!=( const error_condition & lhs, const error_code & rhs ) BOOST_NOEXCEPT - { - return !( lhs == rhs ); - } - #if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) inline friend bool operator==( std::error_code const & lhs, error_code const & rhs ) BOOST_NOEXCEPT @@ -678,6 +642,37 @@ public: } }; +inline bool operator==( const error_code & code, const error_condition & condition ) BOOST_NOEXCEPT +{ +#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) + + if( code.lc_flags_ == 1 ) + { + return static_cast<std::error_code>( code ) == static_cast<std::error_condition>( condition ); + } + else + +#endif + { + return code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() ); + } +} + +inline bool operator==( const error_condition & condition, const error_code & code ) BOOST_NOEXCEPT +{ + return code == condition; +} + +inline bool operator!=( const error_code & lhs, const error_condition & rhs ) BOOST_NOEXCEPT +{ + return !( lhs == rhs ); +} + +inline bool operator!=( const error_condition & lhs, const error_code & rhs ) BOOST_NOEXCEPT +{ + return !( lhs == rhs ); +} + inline std::size_t hash_value( error_code const & ec ) { #if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) diff --git a/contrib/restricted/boost/system/include/boost/system/detail/error_condition.hpp b/contrib/restricted/boost/system/include/boost/system/detail/error_condition.hpp index a7e35abaf2..b2da2811bf 100644 --- a/contrib/restricted/boost/system/include/boost/system/detail/error_condition.hpp +++ b/contrib/restricted/boost/system/include/boost/system/detail/error_condition.hpp @@ -261,6 +261,58 @@ public: return !( lhs == rhs ); } + // + + template<class E, class N = typename detail::enable_if<std::is_error_condition_enum<E>::value>::type> + BOOST_SYSTEM_CONSTEXPR inline friend bool operator==( error_condition const & lhs, E rhs ) BOOST_NOEXCEPT + { + return lhs == make_error_condition( rhs ); + } + + template<class E, class N = typename detail::enable_if<std::is_error_condition_enum<E>::value>::type> + BOOST_SYSTEM_CONSTEXPR inline friend bool operator==( E lhs, error_condition const & rhs ) BOOST_NOEXCEPT + { + return make_error_condition( lhs ) == rhs; + } + + template<class E, class N = typename detail::enable_if<std::is_error_condition_enum<E>::value>::type> + BOOST_SYSTEM_CONSTEXPR inline friend bool operator!=( error_condition const & lhs, E rhs ) BOOST_NOEXCEPT + { + return !( lhs == rhs ); + } + + template<class E, class N = typename detail::enable_if<std::is_error_condition_enum<E>::value>::type> + BOOST_SYSTEM_CONSTEXPR inline friend bool operator!=( E lhs, error_condition const & rhs ) BOOST_NOEXCEPT + { + return !( lhs == rhs ); + } + + // + + template<class E, class N1 = void, class N2 = typename detail::enable_if<std::is_error_code_enum<E>::value>::type> + inline friend bool operator==( error_condition const & lhs, E rhs ) BOOST_NOEXCEPT + { + return lhs == make_error_code( rhs ); + } + + template<class E, class N1 = void, class N2 = typename detail::enable_if<std::is_error_code_enum<E>::value>::type> + inline friend bool operator==( E lhs, error_condition const & rhs ) BOOST_NOEXCEPT + { + return make_error_code( lhs ) == rhs; + } + + template<class E, class N1 = void, class N2 = typename detail::enable_if<std::is_error_code_enum<E>::value>::type> + inline friend bool operator!=( error_condition const & lhs, E rhs ) BOOST_NOEXCEPT + { + return !( lhs == rhs ); + } + + template<class E, class N1 = void, class N2 = typename detail::enable_if<std::is_error_code_enum<E>::value>::type> + inline friend bool operator!=( E lhs, error_condition const & rhs ) BOOST_NOEXCEPT + { + return !( lhs == rhs ); + } + #endif std::string to_string() const |