diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-04-26 15:33:29 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-05-08 19:37:29 -0700 |
| commit | 06ee65af9ed6aa5ee4d1d7f4fab9d7acecf66e76 (patch) | |
| tree | 1316711b92a43dd5c599e425b8693fa8e1e0c0b7 /lib/libcxx/src/filesystem/filesystem_clock.cpp | |
| parent | bc6ebc6f2597fda1f98842c6f545751fef2a5334 (diff) | |
| download | zig-06ee65af9ed6aa5ee4d1d7f4fab9d7acecf66e76.tar.gz zig-06ee65af9ed6aa5ee4d1d7f4fab9d7acecf66e76.zip | |
libcxx: update to LLVM 18
release/18.x branch, commit 78b99c73ee4b96fe9ce0e294d4632326afb2db42
This adds the flag `-D_LIBCPP_HARDENING_MODE` which is determined based
on the Zig optimization mode.
This commit also fixes libunwind, libcxx, and libcxxabi to properly
report sub compilation errors.
Diffstat (limited to 'lib/libcxx/src/filesystem/filesystem_clock.cpp')
| -rw-r--r-- | lib/libcxx/src/filesystem/filesystem_clock.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/libcxx/src/filesystem/filesystem_clock.cpp b/lib/libcxx/src/filesystem/filesystem_clock.cpp index fbb19ac68d..e13b2853e3 100644 --- a/lib/libcxx/src/filesystem/filesystem_clock.cpp +++ b/lib/libcxx/src/filesystem/filesystem_clock.cpp @@ -16,21 +16,21 @@ #endif #if defined(_LIBCPP_WIN32API) -# define WIN32_LEAN_AND_MEAN -# define NOMINMAX -# include <windows.h> +# define WIN32_LEAN_AND_MEAN +# define NOMINMAX +# include <windows.h> #endif #if __has_include(<unistd.h>) -# include <unistd.h> // _POSIX_TIMERS +# include <unistd.h> // _POSIX_TIMERS #endif #if __has_include(<sys/time.h>) -# include <sys/time.h> // for gettimeofday and timeval +# include <sys/time.h> // for gettimeofday and timeval #endif -#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) -# define _LIBCPP_HAS_CLOCK_GETTIME +#if defined(__APPLE__) || defined(__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) +# define _LIBCPP_HAS_CLOCK_GETTIME #endif _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM @@ -44,15 +44,13 @@ _FilesystemClock::time_point _FilesystemClock::now() noexcept { FILETIME time; GetSystemTimeAsFileTime(&time); detail::TimeSpec tp = detail::filetime_to_timespec(time); - return time_point(__secs(tp.tv_sec) + - chrono::duration_cast<duration>(__nsecs(tp.tv_nsec))); + return time_point(__secs(tp.tv_sec) + chrono::duration_cast<duration>(__nsecs(tp.tv_nsec))); #elif defined(_LIBCPP_HAS_CLOCK_GETTIME) typedef chrono::duration<rep, nano> __nsecs; struct timespec tp; if (0 != clock_gettime(CLOCK_REALTIME, &tp)) __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed"); - return time_point(__secs(tp.tv_sec) + - chrono::duration_cast<duration>(__nsecs(tp.tv_nsec))); + return time_point(__secs(tp.tv_sec) + chrono::duration_cast<duration>(__nsecs(tp.tv_nsec))); #else typedef chrono::duration<rep, micro> __microsecs; timeval tv; |
