aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/src
diff options
context:
space:
mode:
authormikhnenko <mikhnenko@yandex-team.com>2024-12-05 10:49:03 +0300
committermikhnenko <mikhnenko@yandex-team.com>2024-12-05 11:21:12 +0300
commit681668b400e84754eb7acbc0e173491bb4dfc8b2 (patch)
treee809b0abb22e9c506c032e256effebcf9ea88dbd /contrib/libs/cxxsupp/libcxx/src
parentfe60cde3cf1989964159845c2929a65056a8dcf3 (diff)
downloadydb-681668b400e84754eb7acbc0e173491bb4dfc8b2.tar.gz
Update libcxx to 18 Dec 3b0705827dbe711788c6b6bec3afa94205db1ce8
commit_hash:875d8582c26b8bf016af25e00ad77d9bbf081948
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/src')
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/atomic.cpp5
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/barrier.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/call_once.cpp89
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/chrono.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp8
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/experimental/keep.cpp10
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp149
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource_init_helper.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/future.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/hash.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/atomic_support.h24
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h14
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h16
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/sso_allocator.h19
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h42
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ios.cpp34
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/iostream.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/locale.cpp224
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/mutex.cpp79
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp10
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/optional.cpp1
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/print.cpp12
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/regex.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp20
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp16
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/std_stream.h12
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/strstream.cpp12
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/support/win32/thread_win32.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/thread.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/vector.cpp4
38 files changed, 363 insertions, 511 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp
index fc90a1f5b2..133774bf13 100644
--- a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp
@@ -6,9 +6,6 @@
//
//===----------------------------------------------------------------------===//
-#include <__config>
-#ifndef _LIBCPP_HAS_NO_THREADS
-
#include <__thread/timed_backoff_policy.h>
#include <atomic>
#include <climits>
@@ -219,5 +216,3 @@ void __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile* __location,
}
_LIBCPP_END_NAMESPACE_STD
-
-#endif //_LIBCPP_HAS_NO_THREADS
diff --git a/contrib/libs/cxxsupp/libcxx/src/barrier.cpp b/contrib/libs/cxxsupp/libcxx/src/barrier.cpp
index 8ce2c043cf..3242e0865b 100644
--- a/contrib/libs/cxxsupp/libcxx/src/barrier.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/barrier.cpp
@@ -6,10 +6,6 @@
//
//===----------------------------------------------------------------------===//
-#include <__config>
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
#include <barrier>
#include <thread>
@@ -93,5 +89,3 @@ void __destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier)
#endif // !defined(_LIBCPP_HAS_NO_TREE_BARRIER)
_LIBCPP_END_NAMESPACE_STD
-
-#endif //_LIBCPP_HAS_NO_THREADS
diff --git a/contrib/libs/cxxsupp/libcxx/src/call_once.cpp b/contrib/libs/cxxsupp/libcxx/src/call_once.cpp
new file mode 100644
index 0000000000..a4fb1c35f1
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/call_once.cpp
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <__mutex/once_flag.h>
+#include <__utility/exception_guard.h>
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+# include <__threading_support>
+#endif
+
+#include "include/atomic_support.h"
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// If dispatch_once_f ever handles C++ exceptions, and if one can get to it
+// without illegal macros (unexpected macros not beginning with _UpperCase or
+// __lowercase), and if it stops spinning waiting threads, then call_once should
+// call into dispatch_once_f instead of here. Relevant radar this code needs to
+// keep in sync with: 7741191.
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+static constinit __libcpp_mutex_t mut = _LIBCPP_MUTEX_INITIALIZER;
+static constinit __libcpp_condvar_t cv = _LIBCPP_CONDVAR_INITIALIZER;
+#endif
+
+#ifdef _LIBCPP_ABI_MICROSOFT
+void __call_once(volatile std::atomic<once_flag::_State_type>& flag, void* arg,
+ void (*func)(void*))
+#else
+void __call_once(volatile once_flag::_State_type& flag, void* arg,
+ void (*func)(void*))
+#endif
+{
+#if defined(_LIBCPP_HAS_NO_THREADS)
+
+ if (flag == once_flag::_Unset) {
+ auto guard = std::__make_exception_guard([&flag] { flag = once_flag::_Unset; });
+ flag = once_flag::_Pending;
+ func(arg);
+ flag = once_flag::_Complete;
+ guard.__complete();
+ }
+
+#else // !_LIBCPP_HAS_NO_THREADS
+
+ __libcpp_mutex_lock(&mut);
+ while (flag == once_flag::_Pending)
+ __libcpp_condvar_wait(&cv, &mut);
+ if (flag == once_flag::_Unset) {
+ auto guard = std::__make_exception_guard([&flag] {
+ __libcpp_mutex_lock(&mut);
+#ifdef _LIBCPP_ABI_MICROSOFT
+ flag.store(once_flag::_Unset);
+#else
+ __libcpp_relaxed_store(&flag, once_flag::_Unset);
+#endif
+ __libcpp_mutex_unlock(&mut);
+ __libcpp_condvar_broadcast(&cv);
+ });
+
+#ifdef _LIBCPP_ABI_MICROSOFT
+ flag.store(once_flag::_Pending, memory_order_relaxed);
+#else
+ __libcpp_relaxed_store(&flag, once_flag::_Pending);
+#endif
+ __libcpp_mutex_unlock(&mut);
+ func(arg);
+ __libcpp_mutex_lock(&mut);
+#ifdef _LIBCPP_ABI_MICROSOFT
+ flag.store(once_flag::_Complete, memory_order_release);
+#else
+ __libcpp_atomic_store(&flag, once_flag::_Complete, _AO_Release);
+#endif
+ __libcpp_mutex_unlock(&mut);
+ __libcpp_condvar_broadcast(&cv);
+ guard.__complete();
+ } else {
+ __libcpp_mutex_unlock(&mut);
+ }
+
+#endif // !_LIBCPP_HAS_NO_THREADS
+}
+
+_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
index b31ef19c0a..c4446070d0 100644
--- a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
@@ -94,8 +94,8 @@ public:
static system_clock::time_point __libcpp_system_clock_now() {
// FILETIME is in 100ns units
using filetime_duration =
- _VSTD::chrono::duration<__int64,
- _VSTD::ratio_multiply<_VSTD::ratio<100, 1>,
+ std::chrono::duration<__int64,
+ std::ratio_multiply<std::ratio<100, 1>,
nanoseconds::period>>;
// The Windows epoch is Jan 1 1601, the Unix epoch Jan 1 1970.
diff --git a/contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp b/contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp
index 87ce1d8434..33e19568b4 100644
--- a/contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/condition_variable.cpp
@@ -6,10 +6,6 @@
//
//===----------------------------------------------------------------------===//
-#include <__config>
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
#include <condition_variable>
#include <thread>
@@ -92,5 +88,3 @@ notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk)
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-
-#endif // !_LIBCPP_HAS_NO_THREADS
diff --git a/contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp b/contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp
index 333face19d..d39c8f811d 100644
--- a/contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/condition_variable_destructor.cpp
@@ -14,10 +14,8 @@
#include <__config>
#include <__threading_support>
-#if !defined(_LIBCPP_HAS_NO_THREADS)
-# if _LIBCPP_ABI_VERSION == 1 || !defined(_LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION)
-# define NEEDS_CONDVAR_DESTRUCTOR
-# endif
+#if _LIBCPP_ABI_VERSION == 1 || !defined(_LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION)
+# define NEEDS_CONDVAR_DESTRUCTOR
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -28,7 +26,7 @@ class _LIBCPP_EXPORTED_FROM_ABI condition_variable
{
__libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
public:
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
constexpr condition_variable() noexcept = default;
~condition_variable();
diff --git a/contrib/libs/cxxsupp/libcxx/src/experimental/keep.cpp b/contrib/libs/cxxsupp/libcxx/src/experimental/keep.cpp
new file mode 100644
index 0000000000..f3db69d798
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/experimental/keep.cpp
@@ -0,0 +1,10 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// Empty file just to make sure we produce a libc++experimental.a library even
+// when there isn't anything in it.
diff --git a/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp b/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp
deleted file mode 100644
index 0798d2e72c..0000000000
--- a/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include <experimental/memory_resource>
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-
-#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
-# include <atomic>
-#elif !defined(_LIBCPP_HAS_NO_THREADS)
-# include <mutex>
-# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
-# pragma comment(lib, "pthread")
-# endif
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-// memory_resource
-
-//memory_resource::~memory_resource() {}
-
-// new_delete_resource()
-
-class _LIBCPP_EXPORTED_FROM_ABI __new_delete_memory_resource_imp
- : public memory_resource
-{
- void *do_allocate(size_t size, size_t align) override {
-#ifdef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
- if (__is_overaligned_for_new(align))
- __throw_bad_alloc();
-#endif
- return _VSTD::__libcpp_allocate(size, align);
- }
-
- void do_deallocate(void *p, size_t n, size_t align) override {
- _VSTD::__libcpp_deallocate(p, n, align);
- }
-
- bool do_is_equal(memory_resource const & other) const noexcept override
- { return &other == this; }
-
-public:
- ~__new_delete_memory_resource_imp() override = default;
-};
-
-// null_memory_resource()
-
-class _LIBCPP_EXPORTED_FROM_ABI __null_memory_resource_imp
- : public memory_resource
-{
-public:
- ~__null_memory_resource_imp() = default;
-
-protected:
- virtual void* do_allocate(size_t, size_t) {
- __throw_bad_alloc();
- }
- virtual void do_deallocate(void *, size_t, size_t) {}
- virtual bool do_is_equal(memory_resource const & __other) const noexcept
- { return &__other == this; }
-};
-
-namespace {
-
-union ResourceInitHelper {
- struct {
- __new_delete_memory_resource_imp new_delete_res;
- __null_memory_resource_imp null_res;
- } resources;
- char dummy;
- constexpr ResourceInitHelper() : resources() {}
- ~ResourceInitHelper() {}
-};
-
-// Pretend we're inside a system header so the compiler doesn't flag the use of the init_priority
-// attribute with a value that's reserved for the implementation (we're the implementation).
-#include "memory_resource_init_helper.h"
-
-} // end namespace
-
-
-memory_resource * new_delete_resource() noexcept {
- return &res_init.resources.new_delete_res;
-}
-
-memory_resource * null_memory_resource() noexcept {
- return &res_init.resources.null_res;
-}
-
-// default_memory_resource()
-
-static memory_resource *
-__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) noexcept
-{
-#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
- static constinit atomic<memory_resource*> __res{&res_init.resources.new_delete_res};
- if (set) {
- new_res = new_res ? new_res : new_delete_resource();
- // TODO: Can a weaker ordering be used?
- return _VSTD::atomic_exchange_explicit(
- &__res, new_res, memory_order_acq_rel);
- }
- else {
- return _VSTD::atomic_load_explicit(
- &__res, memory_order_acquire);
- }
-#elif !defined(_LIBCPP_HAS_NO_THREADS)
- static constinit memory_resource *res = &res_init.resources.new_delete_res;
- static mutex res_lock;
- if (set) {
- new_res = new_res ? new_res : new_delete_resource();
- lock_guard<mutex> guard(res_lock);
- memory_resource * old_res = res;
- res = new_res;
- return old_res;
- } else {
- lock_guard<mutex> guard(res_lock);
- return res;
- }
-#else
- static constinit memory_resource *res = &res_init.resources.new_delete_res;
- if (set) {
- new_res = new_res ? new_res : new_delete_resource();
- memory_resource * old_res = res;
- res = new_res;
- return old_res;
- } else {
- return res;
- }
-#endif
-}
-
-memory_resource * get_default_resource() noexcept
-{
- return __default_memory_resource();
-}
-
-memory_resource * set_default_resource(memory_resource * __new_res) noexcept
-{
- return __default_memory_resource(true, __new_res);
-}
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
diff --git a/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource_init_helper.h b/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource_init_helper.h
deleted file mode 100644
index 032edc12fa..0000000000
--- a/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource_init_helper.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#pragma GCC system_header
-static constinit ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp
index 4910d390d1..a71c2f9d24 100644
--- a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_entry.cpp
@@ -28,7 +28,7 @@ error_code directory_entry::__do_refresh() noexcept {
return failure_ec;
}
- if (!_VSTD_FS::exists(st) || !_VSTD_FS::is_symlink(st)) {
+ if (!filesystem::exists(st) || !filesystem::is_symlink(st)) {
__data_.__cache_type_ = directory_entry::_RefreshNonSymlink;
__data_.__type_ = st.type();
__data_.__non_sym_perms_ = st.permissions();
@@ -54,10 +54,10 @@ error_code directory_entry::__do_refresh() noexcept {
__data_.__cache_type_ = directory_entry::_RefreshSymlink;
}
- if (_VSTD_FS::is_regular_file(st))
+ if (filesystem::is_regular_file(st))
__data_.__size_ = static_cast<uintmax_t>(full_st.st_size);
- if (_VSTD_FS::exists(st)) {
+ if (filesystem::exists(st)) {
__data_.__nlink_ = static_cast<uintmax_t>(full_st.st_nlink);
// Attempt to extract the mtime, and fail if it's not representable using
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp
index cf9d63196e..a705c5b67e 100644
--- a/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/directory_iterator.cpp
@@ -190,7 +190,7 @@ directory_iterator::directory_iterator(const path& p, error_code* ec,
}
directory_iterator& directory_iterator::__increment(error_code* ec) {
- _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Attempting to increment an invalid iterator");
+ _LIBCPP_ASSERT_NON_NULL(__imp_ != nullptr, "Attempting to increment an invalid iterator");
ErrorHandler<void> err("directory_iterator::operator++()", ec);
error_code m_ec;
@@ -204,7 +204,7 @@ directory_iterator& directory_iterator::__increment(error_code* ec) {
}
directory_entry const& directory_iterator::__dereference() const {
- _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Attempting to dereference an invalid iterator");
+ _LIBCPP_ASSERT_NON_NULL(__imp_ != nullptr, "Attempting to dereference an invalid iterator");
return __imp_->__entry_;
}
@@ -233,7 +233,7 @@ recursive_directory_iterator::recursive_directory_iterator(
}
void recursive_directory_iterator::__pop(error_code* ec) {
- _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Popping the end iterator");
+ _LIBCPP_ASSERT_NON_NULL(__imp_ != nullptr, "Popping the end iterator");
if (ec)
ec->clear();
__imp_->__stack_.pop();
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h
index 7bc0a4d178..03c52e76e6 100644
--- a/contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/file_descriptor.h
@@ -168,7 +168,7 @@ struct FileDescriptor {
file_status get_status() const { return m_status; }
StatT const& get_stat() const { return m_stat; }
- bool status_known() const { return _VSTD_FS::status_known(m_status); }
+ bool status_known() const { return filesystem::status_known(m_status); }
file_status refresh_status(error_code& ec);
diff --git a/contrib/libs/cxxsupp/libcxx/src/future.cpp b/contrib/libs/cxxsupp/libcxx/src/future.cpp
index 3383b506a2..0e3f7b12b8 100644
--- a/contrib/libs/cxxsupp/libcxx/src/future.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/future.cpp
@@ -6,10 +6,6 @@
//
//===----------------------------------------------------------------------===//
-#include <__config>
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
#include <future>
#include <string>
@@ -268,5 +264,3 @@ shared_future<void>::operator=(const shared_future& __rhs)
}
_LIBCPP_END_NAMESPACE_STD
-
-#endif // !_LIBCPP_HAS_NO_THREADS
diff --git a/contrib/libs/cxxsupp/libcxx/src/hash.cpp b/contrib/libs/cxxsupp/libcxx/src/hash.cpp
index 96cbd38f4d..f5bd3e9684 100644
--- a/contrib/libs/cxxsupp/libcxx/src/hash.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/hash.cpp
@@ -147,7 +147,7 @@ const unsigned indices[] =
// against.
template <size_t _Sz = sizeof(size_t)>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
typename enable_if<_Sz == 4, void>::type
__check_for_overflow(size_t N)
{
@@ -156,7 +156,7 @@ __check_for_overflow(size_t N)
}
template <size_t _Sz = sizeof(size_t)>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
typename enable_if<_Sz == 8, void>::type
__check_for_overflow(size_t N)
{
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/atomic_support.h b/contrib/libs/cxxsupp/libcxx/src/include/atomic_support.h
index 3e73f2ce27..debeb745f4 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/atomic_support.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/atomic_support.h
@@ -52,7 +52,7 @@ enum __libcpp_atomic_order {
};
template <class _ValueType, class _FromType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
void __libcpp_atomic_store(_ValueType* __dest, _FromType __val,
int __order = _AO_Seq)
{
@@ -60,14 +60,14 @@ void __libcpp_atomic_store(_ValueType* __dest, _FromType __val,
}
template <class _ValueType, class _FromType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
void __libcpp_relaxed_store(_ValueType* __dest, _FromType __val)
{
__atomic_store_n(__dest, __val, _AO_Relaxed);
}
template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
_ValueType __libcpp_atomic_load(_ValueType const* __val,
int __order = _AO_Seq)
{
@@ -75,7 +75,7 @@ _ValueType __libcpp_atomic_load(_ValueType const* __val,
}
template <class _ValueType, class _AddType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
_ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a,
int __order = _AO_Seq)
{
@@ -83,7 +83,7 @@ _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a,
}
template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
_ValueType __libcpp_atomic_exchange(_ValueType* __target,
_ValueType __value, int __order = _AO_Seq)
{
@@ -91,7 +91,7 @@ _ValueType __libcpp_atomic_exchange(_ValueType* __target,
}
template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
bool __libcpp_atomic_compare_exchange(_ValueType* __val,
_ValueType* __expected, _ValueType __after,
int __success_order = _AO_Seq,
@@ -113,7 +113,7 @@ enum __libcpp_atomic_order {
};
template <class _ValueType, class _FromType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
void __libcpp_atomic_store(_ValueType* __dest, _FromType __val,
int = 0)
{
@@ -121,14 +121,14 @@ void __libcpp_atomic_store(_ValueType* __dest, _FromType __val,
}
template <class _ValueType, class _FromType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
void __libcpp_relaxed_store(_ValueType* __dest, _FromType __val)
{
*__dest = __val;
}
template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
_ValueType __libcpp_atomic_load(_ValueType const* __val,
int = 0)
{
@@ -136,7 +136,7 @@ _ValueType __libcpp_atomic_load(_ValueType const* __val,
}
template <class _ValueType, class _AddType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
_ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a,
int = 0)
{
@@ -144,7 +144,7 @@ _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a,
}
template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
_ValueType __libcpp_atomic_exchange(_ValueType* __target,
_ValueType __value, int = _AO_Seq)
{
@@ -154,7 +154,7 @@ _ValueType __libcpp_atomic_exchange(_ValueType* __target,
}
template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_HIDE_FROM_ABI
bool __libcpp_atomic_compare_exchange(_ValueType* __val,
_ValueType* __expected, _ValueType __after,
int = 0, int = 0)
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h b/contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h
index 23cb7d3b77..d5168d8710 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/ryu/common.h
@@ -52,7 +52,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Function precondition: __v is not a 10-digit number.
// (f2s: 9 digits are sufficient for round-tripping.)
// (d2fixed: We print 9-digit blocks.)
- _LIBCPP_ASSERT_UNCATEGORIZED(__v < 1000000000, "");
+ _LIBCPP_ASSERT_INTERNAL(__v < 1000000000, "");
if (__v >= 100000000) { return 9; }
if (__v >= 10000000) { return 8; }
if (__v >= 1000000) { return 7; }
@@ -69,24 +69,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// This approximation works up to the point that the multiplication overflows at __e = 3529.
// If the multiplication were done in 64 bits, it would fail at 5^4004 which is just greater
// than 2^9297.
- _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
- _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 3528, "");
+ _LIBCPP_ASSERT_INTERNAL(__e >= 0, "");
+ _LIBCPP_ASSERT_INTERNAL(__e <= 3528, "");
return static_cast<int32_t>(((static_cast<uint32_t>(__e) * 1217359) >> 19) + 1);
}
// Returns floor(log_10(2^__e)).
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __log10Pow2(const int32_t __e) {
// The first value this approximation fails for is 2^1651 which is just greater than 10^297.
- _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
- _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 1650, "");
+ _LIBCPP_ASSERT_INTERNAL(__e >= 0, "");
+ _LIBCPP_ASSERT_INTERNAL(__e <= 1650, "");
return (static_cast<uint32_t>(__e) * 78913) >> 18;
}
// Returns floor(log_10(5^__e)).
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __log10Pow5(const int32_t __e) {
// The first value this approximation fails for is 5^2621 which is just greater than 10^1832.
- _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
- _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 2620, "");
+ _LIBCPP_ASSERT_INTERNAL(__e >= 0, "");
+ _LIBCPP_ASSERT_INTERNAL(__e <= 2620, "");
return (static_cast<uint32_t>(__e) * 732923) >> 20;
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h b/contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h
index 7697c32ff6..be50361fb3 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/ryu/d2s_intrinsics.h
@@ -63,7 +63,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// (The shift value is in the range [49, 58].)
// Check this here in case a future change requires larger shift
// values. In this case this function needs to be adjusted.
- _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
+ _LIBCPP_ASSERT_INTERNAL(__dist < 64, "");
return __shiftright128(__lo, __hi, static_cast<unsigned char>(__dist));
}
@@ -85,7 +85,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// (The shift value is in the range [49, 58].)
// Check this here in case a future change requires larger shift
// values. In this case this function needs to be adjusted.
- _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
+ _LIBCPP_ASSERT_INTERNAL(__dist < 64, "");
auto __temp = __lo | ((unsigned __int128)__hi << 64);
// For x64 128-bit shfits using the `shrd` instruction and two 64-bit
// registers, the shift value is modulo 64. Thus the `& 63` is free.
@@ -126,13 +126,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint64_t __ryu_shiftright128(const uint64_t __lo, const uint64_t __hi, const uint32_t __dist) {
// We don't need to handle the case __dist >= 64 here (see above).
- _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
+ _LIBCPP_ASSERT_INTERNAL(__dist < 64, "");
#ifdef _LIBCPP_64_BIT
- _LIBCPP_ASSERT_UNCATEGORIZED(__dist > 0, "");
+ _LIBCPP_ASSERT_INTERNAL(__dist > 0, "");
return (__hi << (64 - __dist)) | (__lo >> __dist);
#else // ^^^ 64-bit ^^^ / vvv 32-bit vvv
// Avoid a 64-bit shift by taking advantage of the range of shift values.
- _LIBCPP_ASSERT_UNCATEGORIZED(__dist >= 32, "");
+ _LIBCPP_ASSERT_INTERNAL(__dist >= 32, "");
return (__hi << (64 - __dist)) | (static_cast<uint32_t>(__lo >> 32) >> (__dist - 32));
#endif // ^^^ 32-bit ^^^
}
@@ -227,7 +227,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __pow5Factor(uint64_t __value) {
uint32_t __count = 0;
for (;;) {
- _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
+ _LIBCPP_ASSERT_INTERNAL(__value != 0, "");
const uint64_t __q = __div5(__value);
const uint32_t __r = static_cast<uint32_t>(__value) - 5 * static_cast<uint32_t>(__q);
if (__r != 0) {
@@ -247,8 +247,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// Returns true if __value is divisible by 2^__p.
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline bool __multipleOfPowerOf2(const uint64_t __value, const uint32_t __p) {
- _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
- _LIBCPP_ASSERT_UNCATEGORIZED(__p < 64, "");
+ _LIBCPP_ASSERT_INTERNAL(__value != 0, "");
+ _LIBCPP_ASSERT_INTERNAL(__p < 64, "");
// __builtin_ctzll doesn't appear to be faster here.
return (__value & ((1ull << __p) - 1)) == 0;
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/sso_allocator.h b/contrib/libs/cxxsupp/libcxx/src/include/sso_allocator.h
index 6a682fc43f..679a3b9a15 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/sso_allocator.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/sso_allocator.h
@@ -11,6 +11,7 @@
#define _LIBCPP_SSO_ALLOCATOR_H
#include <__config>
+#include <cstddef>
#include <memory>
#include <new>
#include <type_traits>
@@ -34,7 +35,7 @@ public:
template <class _Tp, size_t _Np>
class _LIBCPP_HIDDEN __sso_allocator
{
- typename aligned_storage<sizeof(_Tp) * _Np>::type buf_;
+ alignas(_Tp) std::byte buf_[sizeof(_Tp) * _Np];
bool __allocated_;
public:
typedef size_t size_type;
@@ -46,14 +47,14 @@ public:
using other = __sso_allocator<U, _Np>;
};
- _LIBCPP_INLINE_VISIBILITY __sso_allocator() throw() : __allocated_(false) {}
- _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator&) throw() : __allocated_(false) {}
- template <class _Up> _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator<_Up, _Np>&) throw()
+ _LIBCPP_HIDE_FROM_ABI __sso_allocator() throw() : __allocated_(false) {}
+ _LIBCPP_HIDE_FROM_ABI __sso_allocator(const __sso_allocator&) throw() : __allocated_(false) {}
+ template <class _Up> _LIBCPP_HIDE_FROM_ABI __sso_allocator(const __sso_allocator<_Up, _Np>&) throw()
: __allocated_(false) {}
private:
__sso_allocator& operator=(const __sso_allocator&);
public:
- _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator<void, _Np>::const_pointer = nullptr)
+ _LIBCPP_HIDE_FROM_ABI pointer allocate(size_type __n, typename __sso_allocator<void, _Np>::const_pointer = nullptr)
{
if (!__allocated_ && __n <= _Np)
{
@@ -62,18 +63,18 @@ public:
}
return allocator<_Tp>().allocate(__n);
}
- _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type __n)
+ _LIBCPP_HIDE_FROM_ABI void deallocate(pointer __p, size_type __n)
{
if (__p == (pointer)&buf_)
__allocated_ = false;
else
allocator<_Tp>().deallocate(__p, __n);
}
- _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
+ _LIBCPP_HIDE_FROM_ABI size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
bool operator==(const __sso_allocator& __a) const {return &buf_ == &__a.buf_;}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_HIDE_FROM_ABI
bool operator!=(const __sso_allocator& __a) const {return &buf_ != &__a.buf_;}
};
diff --git a/contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h b/contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h
index e2409338b9..3110bc20e1 100644
--- a/contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h
+++ b/contrib/libs/cxxsupp/libcxx/src/include/to_chars_floating_point.h
@@ -37,7 +37,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace __itoa {
inline constexpr char _Charconv_digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
-static_assert(_VSTD::size(_Charconv_digits) == 36);
+static_assert(std::size(_Charconv_digits) == 36);
} // __itoa
// vvvvvvvvvv DERIVED FROM corecrt_internal_fltintrn.h vvvvvvvvvv
@@ -119,7 +119,7 @@ to_chars_result _Floating_to_chars_hex_precision(
using _Traits = _Floating_type_traits<_Floating>;
using _Uint_type = typename _Traits::_Uint_type;
- const _Uint_type _Uint_value = _VSTD::bit_cast<_Uint_type>(_Value);
+ const _Uint_type _Uint_value = std::bit_cast<_Uint_type>(_Value);
const _Uint_type _Ieee_mantissa = _Uint_value & _Traits::_Denormal_mantissa_mask;
const int32_t _Ieee_exponent = static_cast<int32_t>(_Uint_value >> _Traits::_Exponent_shift);
@@ -307,7 +307,7 @@ to_chars_result _Floating_to_chars_hex_precision(
if (_Number_of_bits_remaining == 0) {
// We've finished printing _Adjusted_mantissa, so all remaining hexits are '0'.
- _VSTD::memset(_First, '0', static_cast<size_t>(_Precision));
+ std::memset(_First, '0', static_cast<size_t>(_Precision));
_First += _Precision;
break;
}
@@ -330,7 +330,7 @@ to_chars_result _Floating_to_chars_hex_precision(
*_First++ = _Sign_character;
// We've already printed '-' if necessary, so uint32_t _Absolute_exponent avoids testing that again.
- return _VSTD::to_chars(_First, _Last, _Absolute_exponent);
+ return std::to_chars(_First, _Last, _Absolute_exponent);
}
template <class _Floating>
@@ -347,7 +347,7 @@ to_chars_result _Floating_to_chars_hex_shortest(
using _Traits = _Floating_type_traits<_Floating>;
using _Uint_type = typename _Traits::_Uint_type;
- const _Uint_type _Uint_value = _VSTD::bit_cast<_Uint_type>(_Value);
+ const _Uint_type _Uint_value = std::bit_cast<_Uint_type>(_Value);
if (_Uint_value == 0) { // zero detected; write "0p+0" and return
// C11 7.21.6.1 "The fprintf function"/8: "If the value is zero, the exponent is zero."
@@ -359,7 +359,7 @@ to_chars_result _Floating_to_chars_hex_shortest(
return {_Last, errc::value_too_large};
}
- _VSTD::memcpy(_First, _Str, _Len);
+ std::memcpy(_First, _Str, _Len);
return {_First + _Len, errc{}};
}
@@ -457,7 +457,7 @@ to_chars_result _Floating_to_chars_hex_shortest(
}
// We've already printed '-' if necessary, so static_cast<uint32_t> avoids testing that again.
- return _VSTD::to_chars(_First, _Last, static_cast<uint32_t>(_Unbiased_exponent));
+ return std::to_chars(_First, _Last, static_cast<uint32_t>(_Unbiased_exponent));
}
// For general precision, we can use lookup tables to avoid performing trial formatting.
@@ -839,7 +839,7 @@ to_chars_result _Floating_to_chars_general_precision(
using _Traits = _Floating_type_traits<_Floating>;
using _Uint_type = typename _Traits::_Uint_type;
- const _Uint_type _Uint_value = _VSTD::bit_cast<_Uint_type>(_Value);
+ const _Uint_type _Uint_value = std::bit_cast<_Uint_type>(_Value);
if (_Uint_value == 0) { // zero detected; write "0" and return; _Precision is irrelevant due to zero-trimming
if (_First == _Last) {
@@ -890,7 +890,7 @@ to_chars_result _Floating_to_chars_general_precision(
_Table_end = _Table_begin + _Precision + 5;
} else {
_Table_begin = _Tables::_Ordinary_X_table;
- _Table_end = _Table_begin + _VSTD::min(_Precision, _Tables::_Max_P) + 5;
+ _Table_end = _Table_begin + std::min(_Precision, _Tables::_Max_P) + 5;
}
// Profiling indicates that linear search is faster than binary search for small tables.
@@ -898,11 +898,11 @@ to_chars_result _Floating_to_chars_general_precision(
const _Uint_type* const _Table_lower_bound = [=] {
if constexpr (!_IsSame<_Floating, float>::value) {
if (_Precision > 155) { // threshold determined via profiling
- return _VSTD::lower_bound(_Table_begin, _Table_end, _Uint_value, less{});
+ return std::lower_bound(_Table_begin, _Table_end, _Uint_value, less{});
}
}
- return _VSTD::find_if(_Table_begin, _Table_end, [=](const _Uint_type _Elem) { return _Uint_value <= _Elem; });
+ return std::find_if(_Table_begin, _Table_end, [=](const _Uint_type _Elem) { return _Uint_value <= _Elem; });
}();
const ptrdiff_t _Table_index = _Table_lower_bound - _Table_begin;
@@ -937,17 +937,17 @@ to_chars_result _Floating_to_chars_general_precision(
// Write into the local buffer.
// Clamping _Effective_precision allows _Buffer to be as small as possible, and increases efficiency.
if (_Use_fixed_notation) {
- _Effective_precision = _VSTD::min(_Precision - (_Scientific_exponent_X + 1), _Max_fixed_precision);
+ _Effective_precision = std::min(_Precision - (_Scientific_exponent_X + 1), _Max_fixed_precision);
const to_chars_result _Buf_result =
- _Floating_to_chars_fixed_precision(_Buffer, _VSTD::end(_Buffer), _Value, _Effective_precision);
+ _Floating_to_chars_fixed_precision(_Buffer, std::end(_Buffer), _Value, _Effective_precision);
_LIBCPP_ASSERT_UNCATEGORIZED(_Buf_result.ec == errc{}, "");
_Significand_last = _Buf_result.ptr;
} else {
- _Effective_precision = _VSTD::min(_Precision - 1, _Max_scientific_precision);
+ _Effective_precision = std::min(_Precision - 1, _Max_scientific_precision);
const to_chars_result _Buf_result =
- _Floating_to_chars_scientific_precision(_Buffer, _VSTD::end(_Buffer), _Value, _Effective_precision);
+ _Floating_to_chars_scientific_precision(_Buffer, std::end(_Buffer), _Value, _Effective_precision);
_LIBCPP_ASSERT_UNCATEGORIZED(_Buf_result.ec == errc{}, "");
- _Significand_last = _VSTD::find(_Buffer, _Buf_result.ptr, 'e');
+ _Significand_last = std::find(_Buffer, _Buf_result.ptr, 'e');
_Exponent_first = _Significand_last;
_Exponent_last = _Buf_result.ptr;
}
@@ -968,7 +968,7 @@ to_chars_result _Floating_to_chars_general_precision(
if (_Last - _First < _Significand_distance) {
return {_Last, errc::value_too_large};
}
- _VSTD::memcpy(_First, _Significand_first, static_cast<size_t>(_Significand_distance));
+ std::memcpy(_First, _Significand_first, static_cast<size_t>(_Significand_distance));
_First += _Significand_distance;
// Copy the exponent to the output range.
@@ -977,7 +977,7 @@ to_chars_result _Floating_to_chars_general_precision(
if (_Last - _First < _Exponent_distance) {
return {_Last, errc::value_too_large};
}
- _VSTD::memcpy(_First, _Exponent_first, static_cast<size_t>(_Exponent_distance));
+ std::memcpy(_First, _Exponent_first, static_cast<size_t>(_Exponent_distance));
_First += _Exponent_distance;
}
@@ -1002,7 +1002,7 @@ to_chars_result _Floating_to_chars(
using _Traits = _Floating_type_traits<_Floating>;
using _Uint_type = typename _Traits::_Uint_type;
- _Uint_type _Uint_value = _VSTD::bit_cast<_Uint_type>(_Value);
+ _Uint_type _Uint_value = std::bit_cast<_Uint_type>(_Value);
const bool _Was_negative = (_Uint_value & _Traits::_Shifted_sign_mask) != 0;
@@ -1014,7 +1014,7 @@ to_chars_result _Floating_to_chars(
*_First++ = '-';
_Uint_value &= ~_Traits::_Shifted_sign_mask;
- _Value = _VSTD::bit_cast<_Floating>(_Uint_value);
+ _Value = std::bit_cast<_Floating>(_Uint_value);
}
if ((_Uint_value & _Traits::_Shifted_exponent_mask) == _Traits::_Shifted_exponent_mask) {
@@ -1044,7 +1044,7 @@ to_chars_result _Floating_to_chars(
return {_Last, errc::value_too_large};
}
- _VSTD::memcpy(_First, _Str, _Len);
+ std::memcpy(_First, _Str, _Len);
return {_First + _Len, errc{}};
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/ios.cpp b/contrib/libs/cxxsupp/libcxx/src/ios.cpp
index f17cd6e1db..e80007d42c 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ios.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ios.cpp
@@ -152,7 +152,7 @@ static size_t __ios_new_cap(size_t __req_size, size_t __current_cap)
{ // Precondition: __req_size > __current_cap
const size_t mx = std::numeric_limits<size_t>::max() / sizeof(_Tp);
if (__req_size < mx/2)
- return _VSTD::max(2 * __current_cap, __req_size);
+ return std::max(2 * __current_cap, __req_size);
else
return mx;
}
@@ -394,24 +394,24 @@ ios_base::move(ios_base& rhs)
void
ios_base::swap(ios_base& rhs) noexcept
{
- _VSTD::swap(__fmtflags_, rhs.__fmtflags_);
- _VSTD::swap(__precision_, rhs.__precision_);
- _VSTD::swap(__width_, rhs.__width_);
- _VSTD::swap(__rdstate_, rhs.__rdstate_);
- _VSTD::swap(__exceptions_, rhs.__exceptions_);
+ std::swap(__fmtflags_, rhs.__fmtflags_);
+ std::swap(__precision_, rhs.__precision_);
+ std::swap(__width_, rhs.__width_);
+ std::swap(__rdstate_, rhs.__rdstate_);
+ std::swap(__exceptions_, rhs.__exceptions_);
locale& lhs_loc = *reinterpret_cast<locale*>(&__loc_);
locale& rhs_loc = *reinterpret_cast<locale*>(&rhs.__loc_);
- _VSTD::swap(lhs_loc, rhs_loc);
- _VSTD::swap(__fn_, rhs.__fn_);
- _VSTD::swap(__index_, rhs.__index_);
- _VSTD::swap(__event_size_, rhs.__event_size_);
- _VSTD::swap(__event_cap_, rhs.__event_cap_);
- _VSTD::swap(__iarray_, rhs.__iarray_);
- _VSTD::swap(__iarray_size_, rhs.__iarray_size_);
- _VSTD::swap(__iarray_cap_, rhs.__iarray_cap_);
- _VSTD::swap(__parray_, rhs.__parray_);
- _VSTD::swap(__parray_size_, rhs.__parray_size_);
- _VSTD::swap(__parray_cap_, rhs.__parray_cap_);
+ std::swap(lhs_loc, rhs_loc);
+ std::swap(__fn_, rhs.__fn_);
+ std::swap(__index_, rhs.__index_);
+ std::swap(__event_size_, rhs.__event_size_);
+ std::swap(__event_cap_, rhs.__event_cap_);
+ std::swap(__iarray_, rhs.__iarray_);
+ std::swap(__iarray_size_, rhs.__iarray_size_);
+ std::swap(__iarray_cap_, rhs.__iarray_cap_);
+ std::swap(__parray_, rhs.__parray_);
+ std::swap(__parray_size_, rhs.__parray_size_);
+ std::swap(__parray_cap_, rhs.__parray_cap_);
}
void
diff --git a/contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp b/contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp
index 070f989194..aac7a68684 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ios.instantiations.cpp
@@ -31,7 +31,7 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
#endif
// Additional instantiations added later. Whether programs rely on these being
-// available is protected by _LIBCPP_AVAILABILITY_HAS_NO_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1.
+// available is protected by _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1.
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringbuf<char>;
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringstream<char>;
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostringstream<char>;
diff --git a/contrib/libs/cxxsupp/libcxx/src/iostream.cpp b/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
index b0686c9099..4ac686e186 100644
--- a/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
@@ -166,7 +166,7 @@ DoIOSInit::DoIOSInit()
ostream* cerr_ptr = ::new(&cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr, &mb_cerr));
::new(&clog) ostream(cerr_ptr->rdbuf());
cin_ptr->tie(cout_ptr);
- _VSTD::unitbuf(*cerr_ptr);
+ std::unitbuf(*cerr_ptr);
cerr_ptr->tie(cout_ptr);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -176,7 +176,7 @@ DoIOSInit::DoIOSInit()
::new(&wclog) wostream(wcerr_ptr->rdbuf());
wcin_ptr->tie(wcout_ptr);
- _VSTD::unitbuf(*wcerr_ptr);
+ std::unitbuf(*wcerr_ptr);
wcerr_ptr->tie(wcout_ptr);
#endif
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/locale.cpp b/contrib/libs/cxxsupp/libcxx/src/locale.cpp
index 071edb903a..ca3c81c85e 100644
--- a/contrib/libs/cxxsupp/libcxx/src/locale.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/locale.cpp
@@ -6,17 +6,20 @@
//
//===----------------------------------------------------------------------===//
-#include <__utility/unreachable.h>
+#include <__utility/no_destroy.h>
#include <algorithm>
#include <clocale>
#include <codecvt>
+#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <locale>
+#include <new>
#include <string>
#include <type_traits>
#include <typeinfo>
+#include <utility>
#include <vector>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -79,15 +82,14 @@ locale_t __cloc() {
namespace {
-struct release
-{
- void operator()(locale::facet* p) {p->__release_shared();}
+struct releaser {
+ void operator()(locale::facet* p) { p->__release_shared(); }
};
template <class T, class ...Args>
T& make(Args ...args)
{
- static typename aligned_storage<sizeof(T)>::type buf;
+ alignas(T) static std::byte buf[sizeof(T)];
auto *obj = ::new (&buf) T(args...);
return *obj;
}
@@ -153,9 +155,11 @@ public:
{return static_cast<size_t>(id) < facets_.size() && facets_[static_cast<size_t>(id)];}
const locale::facet* use_facet(long id) const;
- static const locale& make_classic();
- static locale& make_global();
-private:
+ void acquire();
+ void release();
+ static __no_destroy<__imp> classic_locale_imp_;
+
+ private:
void install(facet* f, long id);
template <class F> void install(F* f) {install(f, f->id.__get());}
template <class F> void install_from(const __imp& other);
@@ -167,13 +171,13 @@ locale::__imp::__imp(size_t refs)
name_("C")
{
facets_.clear();
- install(&make<_VSTD::collate<char> >(1u));
+ install(&make<std::collate<char> >(1u));
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
- install(&make<_VSTD::collate<wchar_t> >(1u));
+ install(&make<std::collate<wchar_t> >(1u));
#endif
- install(&make<_VSTD::ctype<char> >(nullptr, false, 1u));
+ install(&make<std::ctype<char> >(nullptr, false, 1u));
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
- install(&make<_VSTD::ctype<wchar_t> >(1u));
+ install(&make<std::ctype<wchar_t> >(1u));
#endif
install(&make<codecvt<char, char, mbstate_t> >(1u));
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -221,9 +225,9 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(&make<time_put<wchar_t> >(1u));
#endif
- install(&make<_VSTD::messages<char> >(1u));
+ install(&make<std::messages<char> >(1u));
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
- install(&make<_VSTD::messages<wchar_t> >(1u));
+ install(&make<std::messages<wchar_t> >(1u));
#endif
}
@@ -409,28 +413,28 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (c & locale::collate)
{
- install_from<_VSTD::collate<char> >(one);
+ install_from<std::collate<char> >(one);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
- install_from<_VSTD::collate<wchar_t> >(one);
+ install_from<std::collate<wchar_t> >(one);
#endif
}
if (c & locale::ctype)
{
- install_from<_VSTD::ctype<char> >(one);
+ install_from<std::ctype<char> >(one);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
- install_from<_VSTD::ctype<wchar_t> >(one);
+ install_from<std::ctype<wchar_t> >(one);
#endif
- install_from<_VSTD::codecvt<char, char, mbstate_t> >(one);
+ install_from<std::codecvt<char, char, mbstate_t> >(one);
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
- install_from<_VSTD::codecvt<char16_t, char, mbstate_t> >(one);
- install_from<_VSTD::codecvt<char32_t, char, mbstate_t> >(one);
+ install_from<std::codecvt<char16_t, char, mbstate_t> >(one);
+ install_from<std::codecvt<char32_t, char, mbstate_t> >(one);
_LIBCPP_SUPPRESS_DEPRECATED_POP
#ifndef _LIBCPP_HAS_NO_CHAR8_T
- install_from<_VSTD::codecvt<char16_t, char8_t, mbstate_t> >(one);
- install_from<_VSTD::codecvt<char32_t, char8_t, mbstate_t> >(one);
+ install_from<std::codecvt<char16_t, char8_t, mbstate_t> >(one);
+ install_from<std::codecvt<char32_t, char8_t, mbstate_t> >(one);
#endif
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
- install_from<_VSTD::codecvt<wchar_t, char, mbstate_t> >(one);
+ install_from<std::codecvt<wchar_t, char, mbstate_t> >(one);
#endif
}
if (c & locale::monetary)
@@ -478,9 +482,9 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
}
if (c & locale::messages)
{
- install_from<_VSTD::messages<char> >(one);
+ install_from<std::messages<char> >(one);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
- install_from<_VSTD::messages<wchar_t> >(one);
+ install_from<std::messages<wchar_t> >(one);
#endif
}
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
@@ -500,7 +504,7 @@ locale::__imp::__imp(const __imp& other, facet* f, long id)
name_("*")
{
f->__add_shared();
- unique_ptr<facet, release> hold(f);
+ unique_ptr<facet, releaser> hold(f);
facets_ = other.facets_;
for (unsigned i = 0; i < other.facets_.size(); ++i)
if (facets_[i])
@@ -519,7 +523,7 @@ void
locale::__imp::install(facet* f, long id)
{
f->__add_shared();
- unique_ptr<facet, release> hold(f);
+ unique_ptr<facet, releaser> hold(f);
if (static_cast<size_t>(id) >= facets_.size())
facets_.resize(static_cast<size_t>(id+1));
if (facets_[static_cast<size_t>(id)])
@@ -537,95 +541,79 @@ locale::__imp::use_facet(long id) const
// locale
-const locale&
-locale::__imp::make_classic()
-{
- // only one thread can get in here and it only gets in once
- static aligned_storage<sizeof(locale)>::type buf;
- locale* c = reinterpret_cast<locale*>(&buf);
- c->__locale_ = &make<__imp>(1u);
- return *c;
-}
+// We don't do reference counting on the classic locale.
+// It's never destroyed anyway, but atomic reference counting may be very
+// expensive in parallel applications. The classic locale is used by default
+// in all streams. Note: if a new global locale is installed, then we lose
+// the benefit of no reference counting.
+constinit __no_destroy<locale::__imp>
+ locale::__imp::classic_locale_imp_(__uninitialized_tag{}); // initialized below in classic()
-const locale&
-locale::classic()
-{
- static const locale& c = __imp::make_classic();
- return c;
+const locale& locale::classic() {
+ static const __no_destroy<locale> classic_locale(__private_tag{}, [] {
+ // executed exactly once on first initialization of `classic_locale`
+ locale::__imp::classic_locale_imp_.__emplace(1u);
+ return &locale::__imp::classic_locale_imp_.__get();
+ }());
+ return classic_locale.__get();
}
-locale&
-locale::__imp::make_global()
-{
- // only one thread can get in here and it only gets in once
- static aligned_storage<sizeof(locale)>::type buf;
- auto *obj = ::new (&buf) locale(locale::classic());
- return *obj;
+locale& locale::__global() {
+ static __no_destroy<locale> g(locale::classic());
+ return g.__get();
}
-locale&
-locale::__global()
-{
- static locale& g = __imp::make_global();
- return g;
+void locale::__imp::acquire() {
+ if (this != &locale::__imp::classic_locale_imp_.__get())
+ __add_shared();
}
-locale::locale() noexcept
- : __locale_(__global().__locale_)
-{
- __locale_->__add_shared();
+void locale::__imp::release() {
+ if (this != &locale::__imp::classic_locale_imp_.__get())
+ __release_shared();
}
-locale::locale(const locale& l) noexcept
- : __locale_(l.__locale_)
-{
- __locale_->__add_shared();
-}
+locale::locale() noexcept : __locale_(__global().__locale_) { __locale_->acquire(); }
-locale::~locale()
-{
- __locale_->__release_shared();
-}
+locale::locale(const locale& l) noexcept : __locale_(l.__locale_) { __locale_->acquire(); }
+
+locale::~locale() { __locale_->release(); }
const locale&
locale::operator=(const locale& other) noexcept
{
- other.__locale_->__add_shared();
- __locale_->__release_shared();
- __locale_ = other.__locale_;
- return *this;
+ other.__locale_->acquire();
+ __locale_->release();
+ __locale_ = other.__locale_;
+ return *this;
}
locale::locale(const char* name)
: __locale_(name ? new __imp(name)
: (__throw_runtime_error("locale constructed with null"), nullptr))
{
- __locale_->__add_shared();
+ __locale_->acquire();
}
-locale::locale(const string& name)
- : __locale_(new __imp(name))
-{
- __locale_->__add_shared();
-}
+locale::locale(const string& name) : __locale_(new __imp(name)) { __locale_->acquire(); }
locale::locale(const locale& other, const char* name, category c)
: __locale_(name ? new __imp(*other.__locale_, name, c)
: (__throw_runtime_error("locale constructed with null"), nullptr))
{
- __locale_->__add_shared();
+ __locale_->acquire();
}
locale::locale(const locale& other, const string& name, category c)
: __locale_(new __imp(*other.__locale_, name, c))
{
- __locale_->__add_shared();
+ __locale_->acquire();
}
locale::locale(const locale& other, const locale& one, category c)
: __locale_(new __imp(*other.__locale_, *one.__locale_, c))
{
- __locale_->__add_shared();
+ __locale_->acquire();
}
string
@@ -641,7 +629,7 @@ locale::__install_ctor(const locale& other, facet* f, long id)
__locale_ = new __imp(*other.__locale_, f, id);
else
__locale_ = other.__locale_;
- __locale_->__add_shared();
+ __locale_->acquire();
}
locale
@@ -1084,6 +1072,7 @@ extern "C" const unsigned short* const _ctype_android;
const ctype<char>::mask*
ctype<char>::classic_table() noexcept
{
+ // clang-format off
static constexpr const ctype<char>::mask builtin_table[table_size] = {
cntrl, cntrl,
cntrl, cntrl,
@@ -1158,6 +1147,7 @@ ctype<char>::classic_table() noexcept
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
+ // clang-format on
return builtin_table;
}
#else
@@ -2001,10 +1991,9 @@ utf8_to_utf16(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nx
}
else if (c1 < 0xF0)
{
- if (frm_end-frm_nxt < 3)
+ if (frm_end-frm_nxt < 2)
return codecvt_base::partial;
uint8_t c2 = frm_nxt[1];
- uint8_t c3 = frm_nxt[2];
switch (c1)
{
case 0xE0:
@@ -2020,6 +2009,9 @@ utf8_to_utf16(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nx
return codecvt_base::error;
break;
}
+ if (frm_end-frm_nxt < 3)
+ return codecvt_base::partial;
+ uint8_t c3 = frm_nxt[2];
if ((c3 & 0xC0) != 0x80)
return codecvt_base::error;
uint16_t t = static_cast<uint16_t>(((c1 & 0x0F) << 12)
@@ -2032,11 +2024,9 @@ utf8_to_utf16(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nx
}
else if (c1 < 0xF5)
{
- if (frm_end-frm_nxt < 4)
+ if (frm_end-frm_nxt < 2)
return codecvt_base::partial;
uint8_t c2 = frm_nxt[1];
- uint8_t c3 = frm_nxt[2];
- uint8_t c4 = frm_nxt[3];
switch (c1)
{
case 0xF0:
@@ -2052,8 +2042,16 @@ utf8_to_utf16(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nx
return codecvt_base::error;
break;
}
- if ((c3 & 0xC0) != 0x80 || (c4 & 0xC0) != 0x80)
- return codecvt_base::error;
+ if (frm_end-frm_nxt < 3)
+ return codecvt_base::partial;
+ uint8_t c3 = frm_nxt[2];
+ if ((c3 & 0xC0) != 0x80)
+ return codecvt_base::error;
+ if (frm_end-frm_nxt < 4)
+ return codecvt_base::partial;
+ uint8_t c4 = frm_nxt[3];
+ if ((c4 & 0xC0) != 0x80)
+ return codecvt_base::error;
if (to_end-to_nxt < 2)
return codecvt_base::partial;
if ((((c1 & 7UL) << 18) +
@@ -2122,10 +2120,9 @@ utf8_to_utf16(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nx
}
else if (c1 < 0xF0)
{
- if (frm_end-frm_nxt < 3)
+ if (frm_end-frm_nxt < 2)
return codecvt_base::partial;
uint8_t c2 = frm_nxt[1];
- uint8_t c3 = frm_nxt[2];
switch (c1)
{
case 0xE0:
@@ -2141,6 +2138,9 @@ utf8_to_utf16(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nx
return codecvt_base::error;
break;
}
+ if (frm_end-frm_nxt < 3)
+ return codecvt_base::partial;
+ uint8_t c3 = frm_nxt[2];
if ((c3 & 0xC0) != 0x80)
return codecvt_base::error;
uint16_t t = static_cast<uint16_t>(((c1 & 0x0F) << 12)
@@ -2153,11 +2153,9 @@ utf8_to_utf16(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nx
}
else if (c1 < 0xF5)
{
- if (frm_end-frm_nxt < 4)
+ if (frm_end-frm_nxt < 2)
return codecvt_base::partial;
uint8_t c2 = frm_nxt[1];
- uint8_t c3 = frm_nxt[2];
- uint8_t c4 = frm_nxt[3];
switch (c1)
{
case 0xF0:
@@ -2173,8 +2171,16 @@ utf8_to_utf16(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nx
return codecvt_base::error;
break;
}
- if ((c3 & 0xC0) != 0x80 || (c4 & 0xC0) != 0x80)
- return codecvt_base::error;
+ if (frm_end-frm_nxt < 3)
+ return codecvt_base::partial;
+ uint8_t c3 = frm_nxt[2];
+ if ((c3 & 0xC0) != 0x80)
+ return codecvt_base::error;
+ if (frm_end-frm_nxt < 4)
+ return codecvt_base::partial;
+ uint8_t c4 = frm_nxt[3];
+ if ((c4 & 0xC0) != 0x80)
+ return codecvt_base::error;
if (to_end-to_nxt < 2)
return codecvt_base::partial;
if ((((c1 & 7UL) << 18) +
@@ -2400,10 +2406,9 @@ utf8_to_ucs4(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nxt
}
else if (c1 < 0xF0)
{
- if (frm_end-frm_nxt < 3)
+ if (frm_end-frm_nxt < 2)
return codecvt_base::partial;
uint8_t c2 = frm_nxt[1];
- uint8_t c3 = frm_nxt[2];
switch (c1)
{
case 0xE0:
@@ -2419,6 +2424,9 @@ utf8_to_ucs4(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nxt
return codecvt_base::error;
break;
}
+ if (frm_end-frm_nxt < 3)
+ return codecvt_base::partial;
+ uint8_t c3 = frm_nxt[2];
if ((c3 & 0xC0) != 0x80)
return codecvt_base::error;
uint32_t t = static_cast<uint32_t>(((c1 & 0x0F) << 12)
@@ -2431,11 +2439,9 @@ utf8_to_ucs4(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nxt
}
else if (c1 < 0xF5)
{
- if (frm_end-frm_nxt < 4)
+ if (frm_end-frm_nxt < 2)
return codecvt_base::partial;
uint8_t c2 = frm_nxt[1];
- uint8_t c3 = frm_nxt[2];
- uint8_t c4 = frm_nxt[3];
switch (c1)
{
case 0xF0:
@@ -2451,8 +2457,16 @@ utf8_to_ucs4(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nxt
return codecvt_base::error;
break;
}
- if ((c3 & 0xC0) != 0x80 || (c4 & 0xC0) != 0x80)
- return codecvt_base::error;
+ if (frm_end-frm_nxt < 3)
+ return codecvt_base::partial;
+ uint8_t c3 = frm_nxt[2];
+ if ((c3 & 0xC0) != 0x80)
+ return codecvt_base::error;
+ if (frm_end-frm_nxt < 4)
+ return codecvt_base::partial;
+ uint8_t c4 = frm_nxt[3];
+ if ((c4 & 0xC0) != 0x80)
+ return codecvt_base::error;
uint32_t t = static_cast<uint32_t>(((c1 & 0x07) << 18)
| ((c2 & 0x3F) << 12)
| ((c3 & 0x3F) << 6)
@@ -2658,10 +2672,9 @@ utf8_to_ucs2(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nxt
}
else if (c1 < 0xF0)
{
- if (frm_end-frm_nxt < 3)
+ if (frm_end-frm_nxt < 2)
return codecvt_base::partial;
uint8_t c2 = frm_nxt[1];
- uint8_t c3 = frm_nxt[2];
switch (c1)
{
case 0xE0:
@@ -2677,6 +2690,9 @@ utf8_to_ucs2(const uint8_t* frm, const uint8_t* frm_end, const uint8_t*& frm_nxt
return codecvt_base::error;
break;
}
+ if (frm_end-frm_nxt < 3)
+ return codecvt_base::partial;
+ uint8_t c3 = frm_nxt[2];
if ((c3 & 0xC0) != 0x80)
return codecvt_base::error;
uint16_t t = static_cast<uint16_t>(((c1 & 0x0F) << 12)
diff --git a/contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp b/contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp
index 3786ec5136..afd1b89208 100644
--- a/contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/memory_resource.cpp
@@ -175,7 +175,7 @@ void* unsynchronized_pool_resource::__adhoc_pool::__do_allocate(memory_resource*
void unsynchronized_pool_resource::__adhoc_pool::__do_deallocate(
memory_resource* upstream, void* p, size_t bytes, size_t align) {
- _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != nullptr, "deallocating a block that was not allocated with this allocator");
+ _LIBCPP_ASSERT_NON_NULL(__first_ != nullptr, "deallocating a block that was not allocated with this allocator");
if (__first_->__start_ == p) {
__chunk_footer* next = __first_->__next_;
upstream->deallocate(p, __first_->__allocation_size(), __first_->__align_);
@@ -401,7 +401,7 @@ void unsynchronized_pool_resource::do_deallocate(void* p, size_t bytes, size_t a
if (i == __num_fixed_pools_)
return __adhoc_pool_.__do_deallocate(__res_, p, bytes, align);
else {
- _LIBCPP_ASSERT_UNCATEGORIZED(
+ _LIBCPP_ASSERT_NON_NULL(
__fixed_pools_ != nullptr, "deallocating a block that was not allocated with this allocator");
__fixed_pools_[i].__evacuate(p);
}
diff --git a/contrib/libs/cxxsupp/libcxx/src/mutex.cpp b/contrib/libs/cxxsupp/libcxx/src/mutex.cpp
index e8637f9275..11f7be38e2 100644
--- a/contrib/libs/cxxsupp/libcxx/src/mutex.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/mutex.cpp
@@ -16,10 +16,8 @@
#include "include/atomic_support.h"
#endif
-#ifndef _LIBCPP_HAS_NO_THREADS
-# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
-# pragma comment(lib, "pthread")
-# endif
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
+# pragma comment(lib, "pthread")
#endif
_LIBCPP_PUSH_MACROS
@@ -27,8 +25,6 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_HAS_NO_THREADS
-
// ~mutex is defined elsewhere
void
@@ -191,77 +187,6 @@ recursive_timed_mutex::unlock() noexcept
}
}
-#endif // !_LIBCPP_HAS_NO_THREADS
-
-// If dispatch_once_f ever handles C++ exceptions, and if one can get to it
-// without illegal macros (unexpected macros not beginning with _UpperCase or
-// __lowercase), and if it stops spinning waiting threads, then call_once should
-// call into dispatch_once_f instead of here. Relevant radar this code needs to
-// keep in sync with: 7741191.
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-static constinit __libcpp_mutex_t mut = _LIBCPP_MUTEX_INITIALIZER;
-static constinit __libcpp_condvar_t cv = _LIBCPP_CONDVAR_INITIALIZER;
-#endif
-
-#ifdef _LIBCPP_ABI_MICROSOFT
-void __call_once(volatile std::atomic<once_flag::_State_type>& flag, void* arg,
- void (*func)(void*))
-#else
-void __call_once(volatile once_flag::_State_type& flag, void* arg,
- void (*func)(void*))
-#endif
-{
-#if defined(_LIBCPP_HAS_NO_THREADS)
-
- if (flag == once_flag::_Unset) {
- auto guard = std::__make_exception_guard([&flag] { flag = once_flag::_Unset; });
- flag = once_flag::_Pending;
- func(arg);
- flag = once_flag::_Complete;
- guard.__complete();
- }
-
-#else // !_LIBCPP_HAS_NO_THREADS
-
- __libcpp_mutex_lock(&mut);
- while (flag == once_flag::_Pending)
- __libcpp_condvar_wait(&cv, &mut);
- if (flag == once_flag::_Unset) {
- auto guard = std::__make_exception_guard([&flag] {
- __libcpp_mutex_lock(&mut);
-#ifdef _LIBCPP_ABI_MICROSOFT
- flag.store(once_flag::_Unset);
-#else
- __libcpp_relaxed_store(&flag, once_flag::_Unset);
-#endif
- __libcpp_mutex_unlock(&mut);
- __libcpp_condvar_broadcast(&cv);
- });
-
-#ifdef _LIBCPP_ABI_MICROSOFT
- flag.store(once_flag::_Pending, memory_order_relaxed);
-#else
- __libcpp_relaxed_store(&flag, once_flag::_Pending);
-#endif
- __libcpp_mutex_unlock(&mut);
- func(arg);
- __libcpp_mutex_lock(&mut);
-#ifdef _LIBCPP_ABI_MICROSOFT
- flag.store(once_flag::_Complete, memory_order_release);
-#else
- __libcpp_atomic_store(&flag, once_flag::_Complete, _AO_Release);
-#endif
- __libcpp_mutex_unlock(&mut);
- __libcpp_condvar_broadcast(&cv);
- guard.__complete();
- } else {
- __libcpp_mutex_unlock(&mut);
- }
-
-#endif // !_LIBCPP_HAS_NO_THREADS
-}
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp b/contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp
index d366a4e1b3..5f06370332 100644
--- a/contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/mutex_destructor.cpp
@@ -19,10 +19,8 @@
#include <__config>
#include <__threading_support>
-#if !defined(_LIBCPP_HAS_NO_THREADS)
-# if _LIBCPP_ABI_VERSION == 1 || !defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION)
-# define NEEDS_MUTEX_DESTRUCTOR
-# endif
+#if _LIBCPP_ABI_VERSION == 1 || !defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION)
+# define NEEDS_MUTEX_DESTRUCTOR
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -33,7 +31,7 @@ class _LIBCPP_EXPORTED_FROM_ABI mutex
__libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
public:
- _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI
constexpr mutex() = default;
mutex(const mutex&) = delete;
mutex& operator=(const mutex&) = delete;
@@ -45,6 +43,6 @@ mutex::~mutex() noexcept
{
__libcpp_mutex_destroy(&__m_);
}
+#endif // !NEEDS_MUTEX_DESTRUCTOR
-#endif // !_LIBCPP_HAS_NO_THREADS
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/optional.cpp b/contrib/libs/cxxsupp/libcxx/src/optional.cpp
index d0214981a2..fc91152f01 100644
--- a/contrib/libs/cxxsupp/libcxx/src/optional.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/optional.cpp
@@ -8,6 +8,7 @@
#include <__availability>
#include <optional>
+#include <stdexcept>
namespace std
{
diff --git a/contrib/libs/cxxsupp/libcxx/src/print.cpp b/contrib/libs/cxxsupp/libcxx/src/print.cpp
index a581dd37fe..3692187a59 100644
--- a/contrib/libs/cxxsupp/libcxx/src/print.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/print.cpp
@@ -7,10 +7,12 @@
//===----------------------------------------------------------------------===//
#include <__config>
-#include <cstdlib>
-#include <print>
#if defined(_LIBCPP_WIN32API)
+
+# include <cstdlib>
+# include <print>
+
# define WIN32_LEAN_AND_MEAN
# define NOMINMAX
# include <io.h>
@@ -19,11 +21,9 @@
# include <__system_error/system_error.h>
# include "filesystem/error.h"
-#endif
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifdef _WIN32
_LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream) {
// Note the Standard does this in one call, but it's unclear whether
// an invalid handle is allowed when calling GetConsoleMode.
@@ -52,6 +52,6 @@ __write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wst
}
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-#endif // _WIN32
-
_LIBCPP_END_NAMESPACE_STD
+
+#endif // !_LIBCPP_WIN32API
diff --git a/contrib/libs/cxxsupp/libcxx/src/regex.cpp b/contrib/libs/cxxsupp/libcxx/src/regex.cpp
index e53d324186..0825c758bf 100644
--- a/contrib/libs/cxxsupp/libcxx/src/regex.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/regex.cpp
@@ -350,7 +350,7 @@ string
__get_collation_name(const char* s)
{
const collationnames* i =
- _VSTD::lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
+ std::lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
string r;
if (i != end(collatenames) && strcmp(s, i->elem_) == 0)
r = char(i->char_);
@@ -361,7 +361,7 @@ regex_traits<char>::char_class_type
__get_classname(const char* s, bool __icase)
{
const classnames* i =
- _VSTD::lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
+ std::lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
regex_traits<char>::char_class_type r = 0;
if (i != end(ClassNames) && strcmp(s, i->elem_) == 0)
{
diff --git a/contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp b/contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp
index 3ae515d1dc..4cfc395359 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ryu/d2fixed.cpp
@@ -102,8 +102,8 @@ inline constexpr int __POW10_ADDITIONAL_BITS = 120;
const uint64_t __s1low = __low2 + __high1 + __c1; // 128
const uint32_t __c2 = __s1low < __low2; // __high1 + __c1 can't overflow, so compare against __low2
const uint64_t __s1high = __high2 + __c2; // 192
- _LIBCPP_ASSERT_UNCATEGORIZED(__j >= 128, "");
- _LIBCPP_ASSERT_UNCATEGORIZED(__j <= 180, "");
+ _LIBCPP_ASSERT_INTERNAL(__j >= 128, "");
+ _LIBCPP_ASSERT_INTERNAL(__j <= 180, "");
#ifdef _LIBCPP_INTRINSIC128
const uint32_t __dist = static_cast<uint32_t>(__j - 128); // __dist: [0, 52]
const uint64_t __shiftedhigh = __s1high >> __dist;
diff --git a/contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp b/contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp
index 86d0b61848..32d617cb55 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ryu/d2s.cpp
@@ -154,7 +154,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// The average output length is 16.38 digits, so we check high-to-low.
// Function precondition: __v is not an 18, 19, or 20-digit number.
// (17 digits are sufficient for round-tripping.)
- _LIBCPP_ASSERT_UNCATEGORIZED(__v < 100000000000000000u, "");
+ _LIBCPP_ASSERT_INTERNAL(__v < 100000000000000000u, "");
if (__v >= 10000000000000000u) { return 17; }
if (__v >= 1000000000000000u) { return 16; }
if (__v >= 100000000000000u) { return 15; }
diff --git a/contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp b/contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp
index 7470dc63d7..f42fbd68c9 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ryu/f2s.cpp
@@ -86,7 +86,7 @@ inline constexpr uint64_t __FLOAT_POW5_SPLIT[47] = {
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __pow5Factor(uint32_t __value) {
uint32_t __count = 0;
for (;;) {
- _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
+ _LIBCPP_ASSERT_INTERNAL(__value != 0, "");
const uint32_t __q = __value / 5;
const uint32_t __r = __value % 5;
if (__r != 0) {
@@ -105,14 +105,14 @@ inline constexpr uint64_t __FLOAT_POW5_SPLIT[47] = {
// Returns true if __value is divisible by 2^__p.
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline bool __multipleOfPowerOf2(const uint32_t __value, const uint32_t __p) {
- _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
- _LIBCPP_ASSERT_UNCATEGORIZED(__p < 32, "");
+ _LIBCPP_ASSERT_INTERNAL(__value != 0, "");
+ _LIBCPP_ASSERT_INTERNAL(__p < 32, "");
// __builtin_ctz doesn't appear to be faster here.
return (__value & ((1u << __p) - 1)) == 0;
}
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __mulShift(const uint32_t __m, const uint64_t __factor, const int32_t __shift) {
- _LIBCPP_ASSERT_UNCATEGORIZED(__shift > 32, "");
+ _LIBCPP_ASSERT_INTERNAL(__shift > 32, "");
// The casts here help MSVC to avoid calls to the __allmul library
// function.
@@ -134,7 +134,7 @@ inline constexpr uint64_t __FLOAT_POW5_SPLIT[47] = {
#else // ^^^ 32-bit ^^^ / vvv 64-bit vvv
const uint64_t __sum = (__bits0 >> 32) + __bits1;
const uint64_t __shiftedSum = __sum >> (__shift - 32);
- _LIBCPP_ASSERT_UNCATEGORIZED(__shiftedSum <= UINT32_MAX, "");
+ _LIBCPP_ASSERT_INTERNAL(__shiftedSum <= UINT32_MAX, "");
return static_cast<uint32_t>(__shiftedSum);
#endif // ^^^ 64-bit ^^^
}
@@ -309,8 +309,8 @@ struct __floating_decimal_32 {
// Performance note: Long division appears to be faster than losslessly widening float to double and calling
// __d2fixed_buffered_n(). If __f2fixed_buffered_n() is implemented, it might be faster than long division.
- _LIBCPP_ASSERT_UNCATEGORIZED(_Exponent2 > 0, "");
- _LIBCPP_ASSERT_UNCATEGORIZED(_Exponent2 <= 104, ""); // because __ieeeExponent <= 254
+ _LIBCPP_ASSERT_INTERNAL(_Exponent2 > 0, "");
+ _LIBCPP_ASSERT_INTERNAL(_Exponent2 <= 104, ""); // because __ieeeExponent <= 254
// Manually represent _Mantissa2 * 2^_Exponent2 as a large integer. _Mantissa2 is always 24 bits
// (due to the implicit bit), while _Exponent2 indicates a shift of at most 104 bits.
@@ -328,7 +328,7 @@ struct __floating_decimal_32 {
// _Maxidx is the index of the most significant nonzero element.
uint32_t _Maxidx = ((24 + static_cast<uint32_t>(_Exponent2) + 31) / 32) - 1;
- _LIBCPP_ASSERT_UNCATEGORIZED(_Maxidx < _Data_size, "");
+ _LIBCPP_ASSERT_INTERNAL(_Maxidx < _Data_size, "");
const uint32_t _Bit_shift = static_cast<uint32_t>(_Exponent2) % 32;
if (_Bit_shift <= 8) { // _Mantissa2's 24 bits don't cross an element boundary
@@ -388,9 +388,9 @@ struct __floating_decimal_32 {
}
}
- _LIBCPP_ASSERT_UNCATEGORIZED(_Data[0] != 0, "");
+ _LIBCPP_ASSERT_INTERNAL(_Data[0] != 0, "");
for (uint32_t _Idx = 1; _Idx < _Data_size; ++_Idx) {
- _LIBCPP_ASSERT_UNCATEGORIZED(_Data[_Idx] == 0, "");
+ _LIBCPP_ASSERT_INTERNAL(_Data[_Idx] == 0, "");
}
const uint32_t _Data_olength = _Data[0] >= 1000000000 ? 10 : __decimalLength9(_Data[0]);
diff --git a/contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp b/contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp
index 49a51e0271..1a346dda02 100644
--- a/contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/shared_mutex.cpp
@@ -6,15 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#include <__config>
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
-# include <mutex>
-# include <shared_mutex>
-# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
-# pragma comment(lib, "pthread")
-# endif
+#include <mutex>
+#include <shared_mutex>
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
+# pragma comment(lib, "pthread")
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -95,5 +91,3 @@ bool shared_timed_mutex::try_lock_shared() { return __base_.try_lock_shared(); }
void shared_timed_mutex::unlock_shared() { return __base_.unlock_shared(); }
_LIBCPP_END_NAMESPACE_STD
-
-#endif // !_LIBCPP_HAS_NO_THREADS
diff --git a/contrib/libs/cxxsupp/libcxx/src/std_stream.h b/contrib/libs/cxxsupp/libcxx/src/std_stream.h
index 37b4ffd1b4..39a2b70b4f 100644
--- a/contrib/libs/cxxsupp/libcxx/src/std_stream.h
+++ b/contrib/libs/cxxsupp/libcxx/src/std_stream.h
@@ -172,7 +172,7 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
}
char __extbuf[__limit];
- int __nread = _VSTD::max(1, __encoding_);
+ int __nread = std::max(1, __encoding_);
for (int __i = 0; __i < __nread; ++__i)
{
int __c = getc(__file_);
@@ -191,7 +191,7 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
&__1buf, &__1buf + 1, __inxt);
switch (__r)
{
- case _VSTD::codecvt_base::ok:
+ case std::codecvt_base::ok:
break;
case codecvt_base::partial:
*__st_ = __sv_st;
@@ -207,11 +207,11 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
break;
case codecvt_base::error:
return traits_type::eof();
- case _VSTD::codecvt_base::noconv:
+ case std::codecvt_base::noconv:
__1buf = static_cast<char_type>(__extbuf[0]);
break;
}
- } while (__r == _VSTD::codecvt_base::partial);
+ } while (__r == std::codecvt_base::partial);
if (!__consume)
{
for (int __i = __nread; __i > 0;)
@@ -251,9 +251,9 @@ __stdinbuf<_CharT>::pbackfail(int_type __c)
switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
__extbuf, __extbuf + sizeof(__extbuf), __enxt))
{
- case _VSTD::codecvt_base::ok:
+ case std::codecvt_base::ok:
break;
- case _VSTD::codecvt_base::noconv:
+ case std::codecvt_base::noconv:
__extbuf[0] = static_cast<char>(__last_consumed_);
__enxt = __extbuf + 1;
break;
diff --git a/contrib/libs/cxxsupp/libcxx/src/strstream.cpp b/contrib/libs/cxxsupp/libcxx/src/strstream.cpp
index c97db698c0..a9b5989ec4 100644
--- a/contrib/libs/cxxsupp/libcxx/src/strstream.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/strstream.cpp
@@ -79,10 +79,10 @@ strstreambuf::~strstreambuf() {
void strstreambuf::swap(strstreambuf& __rhs) {
streambuf::swap(__rhs);
- _VSTD::swap(__strmode_, __rhs.__strmode_);
- _VSTD::swap(__alsize_, __rhs.__alsize_);
- _VSTD::swap(__palloc_, __rhs.__palloc_);
- _VSTD::swap(__pfree_, __rhs.__pfree_);
+ std::swap(__strmode_, __rhs.__strmode_);
+ std::swap(__alsize_, __rhs.__alsize_);
+ std::swap(__palloc_, __rhs.__palloc_);
+ std::swap(__pfree_, __rhs.__pfree_);
}
void strstreambuf::freeze(bool __freezefl) {
@@ -211,7 +211,7 @@ strstreambuf::pos_type strstreambuf::seekoff(off_type __off, ios_base::seekdir _
char* newpos = eback() + newoff;
if (pos_in)
- setg(eback(), newpos, _VSTD::max(newpos, egptr()));
+ setg(eback(), newpos, std::max(newpos, egptr()));
if (pos_out) {
// min(pbase, newpos), newpos, epptr()
__off = epptr() - newpos;
@@ -237,7 +237,7 @@ strstreambuf::pos_type strstreambuf::seekpos(pos_type __sp, ios_base::openmode _
char* newpos = eback() + newoff;
if (pos_in)
- setg(eback(), newpos, _VSTD::max(newpos, egptr()));
+ setg(eback(), newpos, std::max(newpos, egptr()));
if (pos_out) {
// min(pbase, newpos), newpos, epptr()
off_type temp = epptr() - newpos;
diff --git a/contrib/libs/cxxsupp/libcxx/src/support/win32/thread_win32.cpp b/contrib/libs/cxxsupp/libcxx/src/support/win32/thread_win32.cpp
index c25aefcc34..848ed99cf0 100644
--- a/contrib/libs/cxxsupp/libcxx/src/support/win32/thread_win32.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/support/win32/thread_win32.cpp
@@ -115,7 +115,7 @@ int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m)
int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
__libcpp_timespec_t *__ts)
{
- using namespace _VSTD::chrono;
+ using namespace std::chrono;
auto duration = seconds(__ts->tv_sec) + nanoseconds(__ts->tv_nsec);
auto abstime =
@@ -140,7 +140,7 @@ int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv)
}
// Execute Once
-static inline _LIBCPP_INLINE_VISIBILITY BOOL CALLBACK
+static inline _LIBCPP_HIDE_FROM_ABI BOOL CALLBACK
__libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter,
PVOID *__context)
{
@@ -180,7 +180,7 @@ struct __libcpp_beginthreadex_thunk_data
void *__arg;
};
-static inline _LIBCPP_INLINE_VISIBILITY unsigned WINAPI
+static inline _LIBCPP_HIDE_FROM_ABI unsigned WINAPI
__libcpp_beginthreadex_thunk(void *__raw_data)
{
auto *__data =
diff --git a/contrib/libs/cxxsupp/libcxx/src/thread.cpp b/contrib/libs/cxxsupp/libcxx/src/thread.cpp
index 184b5ae8a1..289c457cd5 100644
--- a/contrib/libs/cxxsupp/libcxx/src/thread.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/thread.cpp
@@ -6,10 +6,6 @@
//
//===----------------------------------------------------------------------===//
-#include <__config>
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-
#include <__thread/poll_with_backoff.h>
#include <__thread/timed_backoff_policy.h>
#include <exception>
@@ -215,5 +211,3 @@ __thread_struct::__make_ready_at_thread_exit(__assoc_sub_state* __s)
}
_LIBCPP_END_NAMESPACE_STD
-
-#endif // !_LIBCPP_HAS_NO_THREADS
diff --git a/contrib/libs/cxxsupp/libcxx/src/vector.cpp b/contrib/libs/cxxsupp/libcxx/src/vector.cpp
index fa63d5c5e3..b09db92cf8 100644
--- a/contrib/libs/cxxsupp/libcxx/src/vector.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/vector.cpp
@@ -22,11 +22,11 @@ struct __vector_base_common<true> {
};
void __vector_base_common<true>::__throw_length_error() const {
- _VSTD::__throw_length_error("vector");
+ std::__throw_length_error("vector");
}
void __vector_base_common<true>::__throw_out_of_range() const {
- _VSTD::__throw_out_of_range("vector");
+ std::__throw_out_of_range("vector");
}
#endif // _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON