aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/src
diff options
context:
space:
mode:
authorAndrey Khalyavin <halyavin@gmail.com>2022-04-07 08:28:36 +0300
committerAndrey Khalyavin <halyavin@gmail.com>2022-04-07 08:28:36 +0300
commit3bd25da701a5b6de40acbea240354462348803d6 (patch)
tree0687f8765d3b10e90a89ccc46536591807553e5c /contrib/libs/cxxsupp/libcxx/src
parent93e82f85e8f923ac94b49a5e520ada8783c45e6a (diff)
downloadydb-3bd25da701a5b6de40acbea240354462348803d6.tar.gz
Update libc++ to 8d23b742 (11 Jan 2022).
Notable changes: * implement in_out_result in ranges * implement uninitialized_copy{,_n} and uninitialized_move{,_n} in ranges * use _LIBCPP_DEBUG_ASSERT in list * alphabetize header includes. * use Fuchsia-native monotonic clock for std::chrono::steady_clock * properly handle specializations of std::is_placeholder * add __cpo namespace to ranges::{advance, next, prev} for ADL reasons * add template lerp function ref:1cc313d57e8757bed1d0950624d0c3a2b7da8a4f
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/src')
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/chrono.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
index 5aa7af75894..4f2d51042ff 100644
--- a/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/chrono.cpp
@@ -44,6 +44,10 @@
# endif
#endif // defined(_LIBCPP_WIN32API)
+#if defined(__Fuchsia__)
+# include <zircon/syscalls.h>
+#endif
+
#if __has_include(<mach/mach_time.h>)
# include <mach/mach_time.h>
#endif
@@ -266,7 +270,18 @@ static steady_clock::time_point __libcpp_steady_clock_now() {
return steady_clock::time_point(seconds(ts.tv_sec) + nanoseconds(ts.tv_nsec));
}
-#elif defined(CLOCK_MONOTONIC)
+# elif defined(__Fuchsia__)
+
+static steady_clock::time_point __libcpp_steady_clock_now() noexcept {
+ // Implicitly link against the vDSO system call ABI without
+ // requiring the final link to specify -lzircon explicitly when
+ // statically linking libc++.
+# pragma comment(lib, "zircon")
+
+ return steady_clock::time_point(nanoseconds(_zx_clock_get_monotonic()));
+}
+
+# elif defined(CLOCK_MONOTONIC)
static steady_clock::time_point __libcpp_steady_clock_now() {
struct timespec tp;
@@ -275,9 +290,9 @@ static steady_clock::time_point __libcpp_steady_clock_now() {
return steady_clock::time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
}
-#else
-# error "Monotonic clock not implemented on this platform"
-#endif
+# else
+# error "Monotonic clock not implemented on this platform"
+# endif
const bool steady_clock::is_steady;