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.
This commit is contained in:
20
lib/libcxx/src/filesystem/filesystem_clock.cpp
vendored
20
lib/libcxx/src/filesystem/filesystem_clock.cpp
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user