diff options
author | mikhnenko <mikhnenko@yandex-team.com> | 2023-10-11 11:15:58 +0300 |
---|---|---|
committer | mikhnenko <mikhnenko@yandex-team.com> | 2023-10-11 12:05:11 +0300 |
commit | 84c5d4bb733b49d5f9f36dbf0c22ec200d9e6334 (patch) | |
tree | 8dc43a7531874e613966d58a48af6acda89954fe /contrib/libs/cxxsupp/libcxx/src | |
parent | b95dc8e862f26368aa0275e2571eefe238c1951e (diff) | |
download | ydb-84c5d4bb733b49d5f9f36dbf0c22ec200d9e6334.tar.gz |
Upd libc++ to 0cc34ca7ecfc9d0efee322f60ed6c3169f4f70ca (12 Apr 2022)
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/src')
4 files changed, 37 insertions, 28 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h index 26130d71ab3..775d33ea7cf 100644 --- a/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h +++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/filesystem_common.h @@ -49,11 +49,11 @@ _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wunused-function") _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-function") #if defined(_LIBCPP_WIN32API) -#define PS(x) (L##x) -#define PATH_CSTR_FMT "\"%ls\"" +# define PATHSTR(x) (L##x) +# define PATH_CSTR_FMT "\"%ls\"" #else -#define PS(x) (x) -#define PATH_CSTR_FMT "\"%s\"" +# define PATHSTR(x) (x) +# define PATH_CSTR_FMT "\"%s\"" #endif _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp index 82d321942a6..5db0115f650 100644 --- a/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp @@ -214,14 +214,14 @@ public: switch (State) { case PS_BeforeBegin: case PS_AtEnd: - return PS(""); + return PATHSTR(""); case PS_InRootDir: if (RawEntry[0] == '\\') - return PS("\\"); + return PATHSTR("\\"); else - return PS("/"); + return PATHSTR("/"); case PS_InTrailingSep: - return PS(""); + return PATHSTR(""); case PS_InRootName: case PS_InFilenames: return RawEntry; @@ -391,8 +391,8 @@ private: }; string_view_pair separate_filename(string_view_t const& s) { - if (s == PS(".") || s == PS("..") || s.empty()) - return string_view_pair{s, PS("")}; + if (s == PATHSTR(".") || s == PATHSTR("..") || s.empty()) + return string_view_pair{s, PATHSTR("")}; auto pos = s.find_last_of('.'); if (pos == string_view_t::npos || pos == 0) return string_view_pair{s, string_view_t{}}; @@ -1620,7 +1620,7 @@ path& path::replace_extension(path const& replacement) { } if (!replacement.empty()) { if (replacement.native()[0] != '.') { - __pn_ += PS("."); + __pn_ += PATHSTR("."); } __pn_.append(replacement.__pn_); } @@ -1742,14 +1742,14 @@ enum PathPartKind : unsigned char { static PathPartKind ClassifyPathPart(string_view_t Part) { if (Part.empty()) return PK_TrailingSep; - if (Part == PS(".")) + if (Part == PATHSTR(".")) return PK_Dot; - if (Part == PS("..")) + if (Part == PATHSTR("..")) return PK_DotDot; - if (Part == PS("/")) + if (Part == PATHSTR("/")) return PK_RootSep; #if defined(_LIBCPP_WIN32API) - if (Part == PS("\\")) + if (Part == PATHSTR("\\")) return PK_RootSep; #endif return PK_Filename; @@ -1799,7 +1799,7 @@ path path::lexically_normal() const { NewPathSize -= Parts.back().first.size(); Parts.pop_back(); } else if (LastKind != PK_RootSep) - AddPart(PK_DotDot, PS("..")); + AddPart(PK_DotDot, PATHSTR("..")); MaybeNeedTrailingSep = LastKind == PK_Filename; break; } @@ -1814,7 +1814,7 @@ path path::lexically_normal() const { } // [fs.path.generic]p6.8: If the path is empty, add a dot. if (Parts.empty()) - return PS("."); + return PATHSTR("."); // [fs.path.generic]p6.7: If the last filename is dot-dot, remove any // trailing directory-separator. @@ -1826,7 +1826,7 @@ path path::lexically_normal() const { Result /= PK.first; if (NeedTrailingSep) - Result /= PS(""); + Result /= PATHSTR(""); Result.make_preferred(); return Result; @@ -1836,9 +1836,9 @@ static int DetermineLexicalElementCount(PathParser PP) { int Count = 0; for (; PP; ++PP) { auto Elem = *PP; - if (Elem == PS("..")) + if (Elem == PATHSTR("..")) --Count; - else if (Elem != PS(".") && Elem != PS("")) + else if (Elem != PATHSTR(".") && Elem != PATHSTR("")) ++Count; } return Count; @@ -1885,15 +1885,15 @@ path path::lexically_relative(const path& base) const { return {}; // if n == 0 and (a == end() || a->empty()), returns path("."); otherwise - if (ElemCount == 0 && (PP.atEnd() || *PP == PS(""))) - return PS("."); + if (ElemCount == 0 && (PP.atEnd() || *PP == PATHSTR(""))) + return PATHSTR("."); // return a path constructed with 'n' dot-dot elements, followed by the the // elements of '*this' after the mismatch. path Result; // FIXME: Reserve enough room in Result that it won't have to re-allocate. while (ElemCount--) - Result /= PS(".."); + Result /= PATHSTR(".."); for (; PP; ++PP) Result /= *PP; return Result; @@ -1906,7 +1906,7 @@ static int CompareRootName(PathParser *LHS, PathParser *RHS) { return 0; auto GetRootName = [](PathParser *Parser) -> string_view_t { - return Parser->inRootName() ? **Parser : PS(""); + return Parser->inRootName() ? **Parser : PATHSTR(""); }; int res = GetRootName(LHS).compare(GetRootName(RHS)); ConsumeRootName(LHS); diff --git a/contrib/libs/cxxsupp/libcxx/src/memory.cpp b/contrib/libs/cxxsupp/libcxx/src/memory.cpp index e4933881bf5..55fc4afe58b 100644 --- a/contrib/libs/cxxsupp/libcxx/src/memory.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/memory.cpp @@ -6,6 +6,11 @@ // //===----------------------------------------------------------------------===// +#include <__config> +#ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS +# define _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS +#endif + #include <memory> #ifndef _LIBCPP_HAS_NO_THREADS @@ -42,7 +47,7 @@ __shared_weak_count::~__shared_weak_count() { } -#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS) +#if defined(_LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS) void __shared_count::__add_shared() noexcept { @@ -91,7 +96,7 @@ __shared_weak_count::__release_shared() noexcept __release_weak(); } -#endif // _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS +#endif // _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS void __shared_weak_count::__release_weak() noexcept diff --git a/contrib/libs/cxxsupp/libcxx/src/system_error.cpp b/contrib/libs/cxxsupp/libcxx/src/system_error.cpp index 66db76c37b5..ba5fa8f30b2 100644 --- a/contrib/libs/cxxsupp/libcxx/src/system_error.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/system_error.cpp @@ -6,8 +6,12 @@ // //===----------------------------------------------------------------------===// -#include <__assert> #include <__config> +#ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS +# define _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS +#endif + +#include <__assert> #include <cerrno> #include <cstdio> #include <cstdlib> @@ -26,7 +30,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD // class error_category -#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS) +#if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS) error_category::error_category() noexcept { } |