aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/src
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-24 13:58:08 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-24 13:58:08 +0300
commit271ac8fd7cc6c125b34b2bce83590db2b2c7e2d7 (patch)
tree78acf3dc1d8f60371fb158e6d731d22b49afcf56 /contrib/libs/cxxsupp/libcxx/src
parentd9fd72590079fc40db118f7993267f5fc8d1ce58 (diff)
downloadydb-271ac8fd7cc6c125b34b2bce83590db2b2c7e2d7.tar.gz
intermediate changes
ref:9eb06e5e31eb4c81bc7f55fa295da8edd4e644bb
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/src')
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/barrier.cpp6
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/chrono.cpp10
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/chrono_system_time_init.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp9
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource_init_helper.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/format.cpp4
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/ios.cpp2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/iostream.cpp13
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/iostream_init.h2
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/random.cpp22
10 files changed, 31 insertions, 41 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/src/barrier.cpp b/contrib/libs/cxxsupp/libcxx/src/barrier.cpp
index 0f9dad987f..54890b2d79 100644
--- a/contrib/libs/cxxsupp/libcxx/src/barrier.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/barrier.cpp
@@ -15,14 +15,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_HAS_NO_TREE_BARRIER) && (_LIBCPP_STD_VER > 11)
+#if !defined(_LIBCPP_HAS_NO_TREE_BARRIER)
class __barrier_algorithm_base {
public:
struct alignas(64) /* naturally-align the heap state */ __state_t
{
struct {
- __atomic_base<__barrier_phase_t> __phase = ATOMIC_VAR_INIT(0);
+ __atomic_base<__barrier_phase_t> __phase{0};
} __tickets[64];
};
@@ -90,7 +90,7 @@ void __destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier)
delete __barrier;
}
-#endif //!defined(_LIBCPP_HAS_NO_TREE_BARRIER) && (_LIBCPP_STD_VER >= 11)
+#endif //!defined(_LIBCPP_HAS_NO_TREE_BARRIER)
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
index b16bf97241..5aa7af7589 100644
--- a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
@@ -80,13 +80,9 @@ public:
GetSystemTimeAsFileTimePtr fp;
};
-#ifndef _LIBCPP_COMPILER_MSVC
-# 83 "chrono.cpp" 1 3
-#endif
-GetSystemTimeInit GetSystemTimeAsFileTimeFunc _LIBCPP_INIT_PRIORITY_MAX;
-#ifndef _LIBCPP_COMPILER_MSVC
-# 85 "chrono.cpp" 2
-#endif
+// 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 "chrono_system_time_init.h"
} // namespace
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/src/chrono_system_time_init.h b/contrib/libs/cxxsupp/libcxx/src/chrono_system_time_init.h
new file mode 100644
index 0000000000..3c5a0c33a5
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/chrono_system_time_init.h
@@ -0,0 +1,2 @@
+#pragma GCC system_header
+GetSystemTimeInit GetSystemTimeAsFileTimeFunc _LIBCPP_INIT_PRIORITY_MAX; \ No newline at end of file
diff --git a/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp b/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp
index be2fb47fad..018d015928 100644
--- a/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource.cpp
@@ -76,9 +76,9 @@ union ResourceInitHelper {
~ResourceInitHelper() {}
};
-# 79 "memory_resource.cpp" 1 3
-_LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
-# 81 "memory_resource.cpp" 2
+// 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
@@ -97,8 +97,7 @@ static memory_resource *
__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) noexcept
{
#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
- _LIBCPP_SAFE_STATIC static atomic<memory_resource*> __res =
- ATOMIC_VAR_INIT(&res_init.resources.new_delete_res);
+ _LIBCPP_SAFE_STATIC static 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?
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
new file mode 100644
index 0000000000..2e1cae5ecc
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/experimental/memory_resource_init_helper.h
@@ -0,0 +1,2 @@
+#pragma GCC system_header
+_LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX; \ No newline at end of file
diff --git a/contrib/libs/cxxsupp/libcxx/src/format.cpp b/contrib/libs/cxxsupp/libcxx/src/format.cpp
index 7ae2af59b7..2ebec28247 100644
--- a/contrib/libs/cxxsupp/libcxx/src/format.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/format.cpp
@@ -10,10 +10,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER > 17
-
format_error::~format_error() noexcept = default;
-#endif //_LIBCPP_STD_VER > 17
-
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libs/cxxsupp/libcxx/src/ios.cpp b/contrib/libs/cxxsupp/libcxx/src/ios.cpp
index a9bd1dc323..56fbcca417 100644
--- a/contrib/libs/cxxsupp/libcxx/src/ios.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/ios.cpp
@@ -137,7 +137,7 @@ ios_base::getloc() const
// xalloc
#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
-atomic<int> ios_base::__xindex_ = ATOMIC_VAR_INIT(0);
+atomic<int> ios_base::__xindex_{0};
#else
int ios_base::__xindex_ = 0;
#endif
diff --git a/contrib/libs/cxxsupp/libcxx/src/iostream.cpp b/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
index 296b5c3f2c..71c8dda834 100644
--- a/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/iostream.cpp
@@ -125,16 +125,9 @@ __asm__("?wclog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_t
#endif
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
-// Hacky way to make the compiler believe that we're inside a system header so
-// it doesn't flag the use of the init_priority attribute with a value that's
-// reserved for the implementation (we're the implementation).
-#ifndef _LIBCPP_COMPILER_MSVC
-# 80 "iostream.cpp" 1 3
-#endif
-_LIBCPP_HIDDEN ios_base::Init __start_std_streams _LIBCPP_INIT_PRIORITY_MAX;
-#ifndef _LIBCPP_COMPILER_MSVC
-# 82 "iostream.cpp" 2
-#endif
+// 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 "iostream_init.h"
// On Windows the TLS storage for locales needs to be initialized before we create
// the standard streams, otherwise it may not be alive during program termination
diff --git a/contrib/libs/cxxsupp/libcxx/src/iostream_init.h b/contrib/libs/cxxsupp/libcxx/src/iostream_init.h
new file mode 100644
index 0000000000..b0a60f42a6
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxx/src/iostream_init.h
@@ -0,0 +1,2 @@
+#pragma GCC system_header
+_LIBCPP_HIDDEN ios_base::Init __start_std_streams _LIBCPP_INIT_PRIORITY_MAX; \ No newline at end of file
diff --git a/contrib/libs/cxxsupp/libcxx/src/random.cpp b/contrib/libs/cxxsupp/libcxx/src/random.cpp
index 83b98c68f4..c4bda825fb 100644
--- a/contrib/libs/cxxsupp/libcxx/src/random.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/random.cpp
@@ -9,8 +9,8 @@
#include <__config>
#if defined(_LIBCPP_USING_WIN32_RANDOM)
-// Must be defined before including stdlib.h to enable rand_s().
-#define _CRT_RAND_S
+ // Must be defined before including stdlib.h to enable rand_s().
+# define _CRT_RAND_S
#endif // defined(_LIBCPP_USING_WIN32_RANDOM)
#include "limits"
@@ -18,7 +18,7 @@
#include "system_error"
#if defined(__sun__)
-#define rename solaris_headers_are_broken
+# define rename solaris_headers_are_broken
#endif // defined(__sun__)
#include <errno.h>
@@ -26,16 +26,16 @@
#include <stdlib.h>
#if defined(_LIBCPP_USING_GETENTROPY)
-#include <sys/random.h>
+# include <sys/random.h>
#elif defined(_LIBCPP_USING_DEV_RANDOM)
-#include <fcntl.h>
-#include <unistd.h>
-#if __has_include(<sys/ioctl.h>) && __has_include(<linux/random.h>)
-#include <sys/ioctl.h>
-#include <linux/random.h>
-#endif
+# include <fcntl.h>
+# include <unistd.h>
+# if __has_include(<sys/ioctl.h>) && __has_include(<linux/random.h>)
+# include <sys/ioctl.h>
+# include <linux/random.h>
+# endif
#elif defined(_LIBCPP_USING_NACL_RANDOM)
-#include <nacl/nacl_random.h>
+# include <nacl/nacl_random.h>
#endif