diff options
author | AlexSm <alex@ydb.tech> | 2023-12-21 15:05:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-21 15:05:38 +0100 |
commit | e98bcbc74422492351c51646dba3849a138a8ffc (patch) | |
tree | 38ad7a09b1f9c201ce8a7e3d69f2017388769224 /contrib/libs/cxxsupp/libcxx | |
parent | 559d7083cd8378cb25b9e966dedcca21d413e338 (diff) | |
download | ydb-e98bcbc74422492351c51646dba3849a138a8ffc.tar.gz |
Import libs 1 (#590)
* Import libs 1
* Add new file without extension
* Add file missed in export config
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx')
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h | 11 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/__config | 3 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/__config_site (renamed from contrib/libs/cxxsupp/libcxx/include/__wrappers_config) | 0 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/__support/android/locale_bionic.h | 4 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/__utility/pair.h | 150 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/initializer_list | 5 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/iostream | 26 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h | 10 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/src/new.cpp | 2 |
9 files changed, 79 insertions, 132 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h b/contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h index 337b562fd9..1d466d669e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h +++ b/contrib/libs/cxxsupp/libcxx/include/__compare/ordering.h @@ -16,14 +16,7 @@ # pragma GCC system_header #endif -#if defined(_MSC_VER) && !defined(__clang__) -// Omit inline namespace __y1, as MSVC2019 fails to find ordering classes -// inside the inlined namespace when compiling the <=> operators. -// See CROWDFUNDING-6 for the details. -namespace std { -#else _LIBCPP_BEGIN_NAMESPACE_STD -#endif #if _LIBCPP_STD_VER > 17 @@ -321,10 +314,6 @@ inline constexpr strong_ordering strong_ordering::greater(_OrdResult::__greater) #endif // _LIBCPP_STD_VER > 17 -#if defined(_MSC_VER) && !defined(__clang__) -} -#else _LIBCPP_END_NAMESPACE_STD -#endif #endif // _LIBCPP___COMPARE_ORDERING_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__config b/contrib/libs/cxxsupp/libcxx/include/__config index 552cfb757c..bf358075a7 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__config +++ b/contrib/libs/cxxsupp/libcxx/include/__config @@ -9,7 +9,8 @@ #ifndef _LIBCPP___CONFIG #define _LIBCPP___CONFIG -#include <__wrappers_config> + +#include <__config_site> #if defined(_MSC_VER) && !defined(__clang__) # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/contrib/libs/cxxsupp/libcxx/include/__wrappers_config b/contrib/libs/cxxsupp/libcxx/include/__config_site index eaa5d522af..eaa5d522af 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__wrappers_config +++ b/contrib/libs/cxxsupp/libcxx/include/__config_site diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/android/locale_bionic.h b/contrib/libs/cxxsupp/libcxx/include/__support/android/locale_bionic.h index 9d19198054..535bad7856 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__support/android/locale_bionic.h +++ b/contrib/libs/cxxsupp/libcxx/include/__support/android/locale_bionic.h @@ -34,9 +34,7 @@ extern "C" { // build, which will always be at least as new as the ToT NDK, in which case we // don't need any of the inlines below since libc provides them. #if __has_include(<android/ndk-version.h>) -#if defined(__has_include) && __has_include(<android/ndk-version.h>) -# include <android/ndk-version.h> -#endif +#include <android/ndk-version.h> // In NDK versions later than 16, locale-aware functions are provided by // legacy_stdlib_inlines.h #if __NDK_MAJOR__ <= 16 diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h b/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h index 518c251eaf..97635c2e61 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h +++ b/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h @@ -73,71 +73,69 @@ struct _LIBCPP_TEMPLATE_VIS pair return *this; } #else - template<bool _Dummy = true, int&... _Args> - struct _EnableImplicitDefaultConstructor { - static constexpr bool value = __is_implicitly_default_constructible<_T1>::value - && __is_implicitly_default_constructible<_T2>::value; + struct _CheckArgs { + template <int&...> + static constexpr bool __enable_explicit_default() { + return is_default_constructible<_T1>::value + && is_default_constructible<_T2>::value + && !__enable_implicit_default<>(); + } + + template <int&...> + static constexpr bool __enable_implicit_default() { + return __is_implicitly_default_constructible<_T1>::value + && __is_implicitly_default_constructible<_T2>::value; + } + + template <class _U1, class _U2> + static constexpr bool __enable_explicit() { + return is_constructible<first_type, _U1>::value + && is_constructible<second_type, _U2>::value + && (!is_convertible<_U1, first_type>::value + || !is_convertible<_U2, second_type>::value); + } + + template <class _U1, class _U2> + static constexpr bool __enable_implicit() { + return is_constructible<first_type, _U1>::value + && is_constructible<second_type, _U2>::value + && is_convertible<_U1, first_type>::value + && is_convertible<_U2, second_type>::value; + } }; - template<bool _Dummy = true, int&... _Args> - struct _EnableExplicitDefaultConstructor { - static constexpr bool value = is_default_constructible<_T1>::value - && is_default_constructible<_T2>::value - && !_EnableImplicitDefaultConstructor<_Dummy, _Args...>::value; - }; - - template <class _U1, class _U2, bool _Dummy = true> - struct _EnableExplicitConstructor { - static constexpr bool value = is_constructible<first_type, _U1>::value - && is_constructible<second_type, _U2>::value - && (!is_convertible<_U1, first_type>::value - || !is_convertible<_U2, second_type>::value); - }; - - template <class _U1, class _U2, bool _Dummy = true> - struct _EnableImplicitConstructor { - static constexpr bool value = is_constructible<first_type, _U1>::value - && is_constructible<second_type, _U2>::value - && is_convertible<_U1, first_type>::value - && is_convertible<_U2, second_type>::value; - }; - - template <class _Tuple, bool _Enable = __tuple_like_with_size<_Tuple, 2>::value - && !is_same<typename decay<_Tuple>::type, pair>::value> - struct _EnableImplicitTupleLikeConstructor { - static constexpr bool value = false; - }; - - template <class _Tuple, bool _Enable = __tuple_like_with_size<_Tuple, 2>::value - && !is_same<typename decay<_Tuple>::type, pair>::value> - struct _EnableExplicitTupleLikeConstructor { - static constexpr bool value = false; - }; - - template <class _Tuple, bool _Enable = __tuple_like_with_size<_Tuple, 2>::value - && !is_same<typename decay<_Tuple>::type, pair>::value> - struct _EnableTupleLikeAssign { - static constexpr bool value = false; - }; - - template <class _Tuple> - struct _EnableImplicitTupleLikeConstructor<_Tuple, true> { - static constexpr bool value = __tuple_convertible<_Tuple, pair>::value; - }; - - template <class _Tuple> - struct _EnableExplicitTupleLikeConstructor<_Tuple, true> { - static constexpr bool value = __tuple_constructible<_Tuple, pair>::value - && !__tuple_convertible<_Tuple, pair>::value; + template <bool _MaybeEnable> + using _CheckArgsDep _LIBCPP_NODEBUG = typename conditional< + _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type; + + struct _CheckTupleLikeConstructor { + template <class _Tuple> + static constexpr bool __enable_implicit() { + return __tuple_convertible<_Tuple, pair>::value; + } + + template <class _Tuple> + static constexpr bool __enable_explicit() { + return __tuple_constructible<_Tuple, pair>::value + && !__tuple_convertible<_Tuple, pair>::value; + } + + template <class _Tuple> + static constexpr bool __enable_assign() { + return __tuple_assignable<_Tuple, pair>::value; + } }; template <class _Tuple> - struct _EnableTupleLikeAssign<_Tuple, true> { - static constexpr bool value = __tuple_assignable<_Tuple, pair>::value; - }; + using _CheckTLC _LIBCPP_NODEBUG = typename conditional< + __tuple_like_with_size<_Tuple, 2>::value + && !is_same<typename decay<_Tuple>::type, pair>::value, + _CheckTupleLikeConstructor, + __check_tuple_constructor_fail + >::type; template<bool _Dummy = true, typename enable_if< - _EnableExplicitDefaultConstructor<_Dummy>::value + _CheckArgsDep<_Dummy>::__enable_explicit_default() >::type* = nullptr> explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value && @@ -145,7 +143,7 @@ struct _LIBCPP_TEMPLATE_VIS pair : first(), second() {} template<bool _Dummy = true, typename enable_if< - _EnableImplicitDefaultConstructor<_Dummy>::value + _CheckArgsDep<_Dummy>::__enable_implicit_default() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value && @@ -153,7 +151,7 @@ struct _LIBCPP_TEMPLATE_VIS pair : first(), second() {} template <bool _Dummy = true, typename enable_if< - _EnableExplicitConstructor<_T1 const&, _T2 const&, _Dummy>::value + _CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit pair(_T1 const& __t1, _T2 const& __t2) @@ -161,8 +159,8 @@ struct _LIBCPP_TEMPLATE_VIS pair is_nothrow_copy_constructible<second_type>::value) : first(__t1), second(__t2) {} - template<bool _Dummy = true, bool _Dummy2 = true, typename enable_if< - _EnableImplicitConstructor<_T1 const&, _T2 const&, _Dummy>::value + template<bool _Dummy = true, typename enable_if< + _CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 pair(_T1 const& __t1, _T2 const& __t2) @@ -176,7 +174,7 @@ struct _LIBCPP_TEMPLATE_VIS pair #else class _U1, class _U2, #endif - typename enable_if<_EnableExplicitConstructor<_U1, _U2>::value>::type* = nullptr + typename enable_if<_CheckArgs::template __enable_explicit<_U1, _U2>()>::type* = nullptr > _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit pair(_U1&& __u1, _U2&& __u2) @@ -184,13 +182,13 @@ struct _LIBCPP_TEMPLATE_VIS pair is_nothrow_constructible<second_type, _U2>::value)) : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {} - template< + template < #if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951 class _U1 = _T1, class _U2 = _T2, #else class _U1, class _U2, #endif - bool _Dummy = true, typename enable_if<_EnableImplicitConstructor<_U1, _U2, _Dummy>::value>::type* = nullptr + typename enable_if<_CheckArgs::template __enable_implicit<_U1, _U2>()>::type* = nullptr > _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 pair(_U1&& __u1, _U2&& __u2) @@ -199,7 +197,7 @@ struct _LIBCPP_TEMPLATE_VIS pair : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {} template<class _U1, class _U2, typename enable_if< - _EnableExplicitConstructor<_U1 const&, _U2 const&>::value + _CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit pair(pair<_U1, _U2> const& __p) @@ -207,8 +205,8 @@ struct _LIBCPP_TEMPLATE_VIS pair is_nothrow_constructible<second_type, _U2 const&>::value)) : first(__p.first), second(__p.second) {} - template<class _U1, class _U2, bool _Dummy = true, typename enable_if< - _EnableImplicitConstructor<_U1 const&, _U2 const&, _Dummy>::value + template<class _U1, class _U2, typename enable_if< + _CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 pair(pair<_U1, _U2> const& __p) @@ -217,7 +215,7 @@ struct _LIBCPP_TEMPLATE_VIS pair : first(__p.first), second(__p.second) {} template<class _U1, class _U2, typename enable_if< - _EnableExplicitConstructor<_U1, _U2>::value + _CheckArgs::template __enable_explicit<_U1, _U2>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit pair(pair<_U1, _U2>&&__p) @@ -225,8 +223,8 @@ struct _LIBCPP_TEMPLATE_VIS pair is_nothrow_constructible<second_type, _U2&&>::value)) : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {} - template<class _U1, class _U2, bool _Dummy = true, typename enable_if< - _EnableImplicitConstructor<_U1, _U2>::value + template<class _U1, class _U2, typename enable_if< + _CheckArgs::template __enable_implicit<_U1, _U2>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 pair(pair<_U1, _U2>&& __p) @@ -235,15 +233,15 @@ struct _LIBCPP_TEMPLATE_VIS pair : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {} template<class _Tuple, typename enable_if< - _EnableExplicitTupleLikeConstructor<_Tuple>::value + _CheckTLC<_Tuple>::template __enable_explicit<_Tuple>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit pair(_Tuple&& __p) : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))), second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {} - template<class _Tuple, bool _Dummy = true, typename enable_if< - _EnableImplicitTupleLikeConstructor<_Tuple>::value + template<class _Tuple, typename enable_if< + _CheckTLC<_Tuple>::template __enable_implicit<_Tuple>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 pair(_Tuple&& __p) @@ -286,8 +284,8 @@ struct _LIBCPP_TEMPLATE_VIS pair return *this; } - template <class _Tuple, bool _Dummy = true, typename enable_if< - _EnableTupleLikeAssign<_Tuple>::value + template <class _Tuple, typename enable_if< + _CheckTLC<_Tuple>::template __enable_assign<_Tuple>() >::type* = nullptr> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair& operator=(_Tuple&& __p) { diff --git a/contrib/libs/cxxsupp/libcxx/include/initializer_list b/contrib/libs/cxxsupp/libcxx/include/initializer_list index 18254801ec..02a8ec57fa 100644 --- a/contrib/libs/cxxsupp/libcxx/include/initializer_list +++ b/contrib/libs/cxxsupp/libcxx/include/initializer_list @@ -80,11 +80,6 @@ public: _LIBCPP_CONSTEXPR_AFTER_CXX11 initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {} - initializer_list(const initializer_list&) = default; - initializer_list(initializer_list&&) = default; - initializer_list& operator=(const initializer_list&) = delete; - initializer_list& operator=(initializer_list&&) = delete; - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 size_t size() const _NOEXCEPT {return __size_;} diff --git a/contrib/libs/cxxsupp/libcxx/include/iostream b/contrib/libs/cxxsupp/libcxx/include/iostream index a0298454da..13d4ac3cad 100644 --- a/contrib/libs/cxxsupp/libcxx/include/iostream +++ b/contrib/libs/cxxsupp/libcxx/include/iostream @@ -49,43 +49,17 @@ extern wostream wclog; _LIBCPP_BEGIN_NAMESPACE_STD -#if defined(_MSC_VER) && !defined(__clang__) -extern _LIBCPP_FUNC_VIS istream& cin; -#else extern _LIBCPP_FUNC_VIS istream cin; -#endif -#if defined(_MSC_VER) && !defined(__clang__) -extern _LIBCPP_FUNC_VIS ostream& cout; -#else extern _LIBCPP_FUNC_VIS ostream cout; -#endif -#if defined(_MSC_VER) && !defined(__clang__) -extern _LIBCPP_FUNC_VIS ostream& cerr; -extern _LIBCPP_FUNC_VIS ostream& clog; -#else extern _LIBCPP_FUNC_VIS ostream cerr; extern _LIBCPP_FUNC_VIS ostream clog; -#endif #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -#if defined(_MSC_VER) && !defined(__clang__) -extern _LIBCPP_FUNC_VIS wistream& wcin; -#else extern _LIBCPP_FUNC_VIS wistream wcin; -#endif -#if defined(_MSC_VER) && !defined(__clang__) -extern _LIBCPP_FUNC_VIS wostream& wcout; -#else extern _LIBCPP_FUNC_VIS wostream wcout; -#endif -#if defined(_MSC_VER) && !defined(__clang__) -extern _LIBCPP_FUNC_VIS wostream& wcerr; -extern _LIBCPP_FUNC_VIS wostream& wclog; -#else extern _LIBCPP_FUNC_VIS wostream wcerr; extern _LIBCPP_FUNC_VIS wostream wclog; #endif -#endif _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h index 775d33ea7c..0bd2bbe6f7 100644 --- a/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h +++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h @@ -135,16 +135,6 @@ size_t error_value<size_t>() { return size_t(-1); } #endif - -#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_IX86) -// FIXME thegeorg@ MSVC on i686 somehow depends on this function presence. -// Further investigation is needed in order to understand the logic behind this. -template <> -unsigned int error_value<unsigned int>() { - return unsigned int(-1); -} -#endif - template <> uintmax_t error_value<uintmax_t>() { return uintmax_t(-1); diff --git a/contrib/libs/cxxsupp/libcxx/src/new.cpp b/contrib/libs/cxxsupp/libcxx/src/new.cpp index 937e860337..4351923cb5 100644 --- a/contrib/libs/cxxsupp/libcxx/src/new.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/new.cpp @@ -9,6 +9,8 @@ #include <new> #include <stdlib.h> +#include "include/atomic_support.h" + #if defined(_LIBCPP_ABI_MICROSOFT) # if !defined(_LIBCPP_ABI_VCRUNTIME) # include "support/runtime/new_handler_fallback.ipp" |