diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-08-07 14:16:49 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-08-07 14:16:49 +0300 |
commit | 5916f81090c43c352126d22287fde40f71aeee95 (patch) | |
tree | 6a8c1cc028b0259bda91377feddfd81aa899bc5d /contrib | |
parent | a89864f26dfb8bf11af76e9b244ccf1f6961d269 (diff) | |
download | ydb-5916f81090c43c352126d22287fde40f71aeee95.tar.gz |
Update contrib/restricted/boost/ratio to 1.79.0
Diffstat (limited to 'contrib')
11 files changed, 145 insertions, 15 deletions
diff --git a/contrib/restricted/boost/align/include/boost/align/align.hpp b/contrib/restricted/boost/align/include/boost/align/align.hpp index ee4371091c..92f0c616b2 100644 --- a/contrib/restricted/boost/align/include/boost/align/align.hpp +++ b/contrib/restricted/boost/align/include/boost/align/align.hpp @@ -10,7 +10,7 @@ Distributed under the Boost Software License, Version 1.0. #include <boost/config.hpp> -#if !defined(BOOST_NO_CXX11_STD_ALIGN) +#if !defined(BOOST_NO_CXX11_STD_ALIGN) && !defined(BOOST_LIBSTDCXX_VERSION) #include <boost/align/detail/align_cxx11.hpp> #else #include <boost/align/detail/align.hpp> diff --git a/contrib/restricted/boost/align/include/boost/align/align_up.hpp b/contrib/restricted/boost/align/include/boost/align/align_up.hpp index 6401ea848a..84e1a3cb58 100644 --- a/contrib/restricted/boost/align/include/boost/align/align_up.hpp +++ b/contrib/restricted/boost/align/include/boost/align/align_up.hpp @@ -9,14 +9,16 @@ Distributed under the Boost Software License, Version 1.0. #define BOOST_ALIGN_ALIGN_UP_HPP #include <boost/align/detail/align_up.hpp> +#include <boost/align/detail/not_pointer.hpp> namespace boost { namespace alignment { -BOOST_CONSTEXPR inline std::size_t -align_up(std::size_t value, std::size_t alignment) BOOST_NOEXCEPT +template<class T> +BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type +align_up(T value, std::size_t alignment) BOOST_NOEXCEPT { - return (value + alignment - 1) & ~(alignment - 1); + return T((value + (T(alignment) - 1)) & ~T(alignment - 1)); } } /* alignment */ diff --git a/contrib/restricted/boost/align/include/boost/align/aligned_alloc.hpp b/contrib/restricted/boost/align/include/boost/align/aligned_alloc.hpp index 42128f1b24..1d81a13372 100644 --- a/contrib/restricted/boost/align/include/boost/align/aligned_alloc.hpp +++ b/contrib/restricted/boost/align/include/boost/align/aligned_alloc.hpp @@ -18,12 +18,16 @@ Distributed under the Boost Software License, Version 1.0. #include <AvailabilityMacros.h> #endif -#if defined(BOOST_ALIGN_USE_ALLOCATE) +#if defined(BOOST_ALIGN_USE_ALIGN) #include <boost/align/detail/aligned_alloc.hpp> +#elif defined(BOOST_ALIGN_USE_NEW) +#include <boost/align/detail/aligned_alloc_new.hpp> #elif defined(_MSC_VER) && !defined(UNDER_CE) #include <boost/align/detail/aligned_alloc_msvc.hpp> #elif defined(__MINGW32__) && (__MSVCRT_VERSION__ >= 0x0700) #include <boost/align/detail/aligned_alloc_msvc.hpp> +#elif defined(__MINGW32__) +#include <boost/align/detail/aligned_alloc_mingw.hpp> #elif MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 #include <boost/align/detail/aligned_alloc_posix.hpp> #elif MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 diff --git a/contrib/restricted/boost/align/include/boost/align/alignment_of.hpp b/contrib/restricted/boost/align/include/boost/align/alignment_of.hpp index 488df0b9e0..b7c50f1a2e 100644 --- a/contrib/restricted/boost/align/include/boost/align/alignment_of.hpp +++ b/contrib/restricted/boost/align/include/boost/align/alignment_of.hpp @@ -11,7 +11,9 @@ Distributed under the Boost Software License, Version 1.0. #include <boost/align/detail/element_type.hpp> #include <boost/align/alignment_of_forward.hpp> -#if defined(BOOST_MSVC) +#if defined(_MSC_VER) && defined(__clang__) +#include <boost/align/detail/alignment_of_cxx11.hpp> +#elif defined(BOOST_MSVC) #include <boost/align/detail/alignment_of_msvc.hpp> #elif defined(__GNUC__) && defined(__unix__) && !defined(__LP64__) #include <boost/align/detail/alignment_of.hpp> @@ -21,7 +23,7 @@ Distributed under the Boost Software License, Version 1.0. #include <boost/align/detail/alignment_of_cxx11.hpp> #elif defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600) #include <boost/align/detail/alignment_of_gcc.hpp> -#elif defined(__CODEGEARC__) +#elif defined(BOOST_CODEGEARC) #include <boost/align/detail/alignment_of_codegear.hpp> #elif defined(BOOST_CLANG) #include <boost/align/detail/alignment_of_clang.hpp> diff --git a/contrib/restricted/boost/align/include/boost/align/detail/align.hpp b/contrib/restricted/boost/align/include/boost/align/detail/align.hpp index 905940ad77..77b327a222 100644 --- a/contrib/restricted/boost/align/include/boost/align/detail/align.hpp +++ b/contrib/restricted/boost/align/include/boost/align/detail/align.hpp @@ -1,5 +1,5 @@ /* -Copyright 2014-2016 Glen Joseph Fernandes +Copyright 2014-2020 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. @@ -18,14 +18,14 @@ inline void* align(std::size_t alignment, std::size_t size, void*& ptr, std::size_t& space) { - BOOST_ASSERT(detail::is_alignment(alignment)); + BOOST_ASSERT(boost::alignment::detail::is_alignment(alignment)); if (size <= space) { char* p = reinterpret_cast<char*>(~(alignment - 1) & (reinterpret_cast<std::size_t>(ptr) + alignment - 1)); - std::size_t n = space - (p - static_cast<char*>(ptr)); - if (size <= n) { + std::size_t n = p - static_cast<char*>(ptr); + if (n <= space - size) { ptr = p; - space = n; + space -= n; return p; } } diff --git a/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc.hpp b/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc.hpp index 69da19659a..d27a549909 100644 --- a/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc.hpp +++ b/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc.hpp @@ -31,7 +31,7 @@ aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT void* p = std::malloc(sizeof(void*) + n); if (p) { void* r = static_cast<char*>(p) + sizeof(void*); - (void)align(alignment, size, r, n); + (void)boost::alignment::align(alignment, size, r, n); *(static_cast<void**>(r) - 1) = p; p = r; } diff --git a/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc_mingw.hpp b/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc_mingw.hpp new file mode 100644 index 0000000000..36be3d5f1d --- /dev/null +++ b/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc_mingw.hpp @@ -0,0 +1,34 @@ +/* +Copyright 2020 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under the Boost Software License, Version 1.0. +(http://www.boost.org/LICENSE_1_0.txt) +*/ +#ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MINGW_HPP +#define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MINGW_HPP + +#include <boost/align/detail/is_alignment.hpp> +#include <boost/assert.hpp> +#include <malloc.h> + +namespace boost { +namespace alignment { + +inline void* +aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + return ::__mingw_aligned_malloc(size, alignment); +} + +inline void +aligned_free(void* ptr) BOOST_NOEXCEPT +{ + ::__mingw_aligned_free(ptr); +} + +} /* alignment */ +} /* boost */ + +#endif diff --git a/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc_new.hpp b/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc_new.hpp new file mode 100644 index 0000000000..a97da65d5a --- /dev/null +++ b/contrib/restricted/boost/align/include/boost/align/detail/aligned_alloc_new.hpp @@ -0,0 +1,52 @@ +/* +Copyright 2014-2015 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under the Boost Software License, Version 1.0. +(http://www.boost.org/LICENSE_1_0.txt) +*/ +#ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_NEW_HPP +#define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_NEW_HPP + +#include <boost/align/detail/is_alignment.hpp> +#include <boost/align/align.hpp> +#include <boost/align/alignment_of.hpp> +#include <boost/assert.hpp> +#include <new> + +namespace boost { +namespace alignment { + +inline void* +aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + enum { + N = alignment_of<void*>::value + }; + if (alignment < N) { + alignment = N; + } + std::size_t n = size + alignment - N; + void* p = ::operator new(sizeof(void*) + n, std::nothrow); + if (p) { + void* r = static_cast<char*>(p) + sizeof(void*); + (void)boost::alignment::align(alignment, size, r, n); + *(static_cast<void**>(r) - 1) = p; + p = r; + } + return p; +} + +inline void +aligned_free(void* ptr) BOOST_NOEXCEPT +{ + if (ptr) { + ::operator delete(*(static_cast<void**>(ptr) - 1)); + } +} + +} /* alignment */ +} /* boost */ + +#endif diff --git a/contrib/restricted/boost/align/include/boost/align/detail/integral_constant.hpp b/contrib/restricted/boost/align/include/boost/align/detail/integral_constant.hpp index 860096783e..a1e0b467ab 100644 --- a/contrib/restricted/boost/align/include/boost/align/detail/integral_constant.hpp +++ b/contrib/restricted/boost/align/include/boost/align/detail/integral_constant.hpp @@ -20,6 +20,8 @@ namespace detail { #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) using std::integral_constant; +using std::true_type; +using std::false_type; #else template<class T, T Value> struct integral_constant { @@ -39,6 +41,9 @@ struct integral_constant { template<class T, T Value> BOOST_CONSTEXPR_OR_CONST T integral_constant<T, Value>::value; + +typedef integral_constant<bool, true> true_type; +typedef integral_constant<bool, false> false_type; #endif } /* detail */ diff --git a/contrib/restricted/boost/align/include/boost/align/detail/not_pointer.hpp b/contrib/restricted/boost/align/include/boost/align/detail/not_pointer.hpp new file mode 100644 index 0000000000..122610182b --- /dev/null +++ b/contrib/restricted/boost/align/include/boost/align/detail/not_pointer.hpp @@ -0,0 +1,27 @@ +/* +Copyright 2019 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under the Boost Software License, Version 1.0. +(http://www.boost.org/LICENSE_1_0.txt) +*/ +#ifndef BOOST_ALIGN_DETAIL_NOT_POINTER_HPP +#define BOOST_ALIGN_DETAIL_NOT_POINTER_HPP + +namespace boost { +namespace alignment { +namespace detail { + +template<class T, class U> +struct not_pointer { + typedef U type; +}; + +template<class T, class U> +struct not_pointer<T*, U> { }; + +} /* detail */ +} /* alignment */ +} /* boost */ + +#endif diff --git a/contrib/restricted/boost/ratio/include/boost/ratio/config.hpp b/contrib/restricted/boost/ratio/include/boost/ratio/config.hpp index 992a256d81..3e4d581298 100644 --- a/contrib/restricted/boost/ratio/include/boost/ratio/config.hpp +++ b/contrib/restricted/boost/ratio/include/boost/ratio/config.hpp @@ -45,14 +45,18 @@ #ifdef INTMAX_C #define BOOST_RATIO_INTMAX_C(a) INTMAX_C(a) -#else +#elif __cplusplus >= 201103L #define BOOST_RATIO_INTMAX_C(a) a##LL +#else +#define BOOST_RATIO_INTMAX_C(a) a##L #endif #ifdef UINTMAX_C #define BOOST_RATIO_UINTMAX_C(a) UINTMAX_C(a) -#else +#elif __cplusplus >= 201103L #define BOOST_RATIO_UINTMAX_C(a) a##ULL +#else +#define BOOST_RATIO_UINTMAX_C(a) a##UL #endif #define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFELL) |