[libcxx-commits] [libcxx] 1cfcc36 - [libc++] Fix GNU/Hurd build
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Aug 25 10:54:59 PDT 2023
Author: Samuel Thibault
Date: 2023-08-25T19:54:54+02:00
New Revision: 1cfcc36812ff7857567f7c729c22ae0e2be0fb3a
URL: https://github.com/llvm/llvm-project/commit/1cfcc36812ff7857567f7c729c22ae0e2be0fb3a
DIFF: https://github.com/llvm/llvm-project/commit/1cfcc36812ff7857567f7c729c22ae0e2be0fb3a.diff
LOG: [libc++] Fix GNU/Hurd build
GNU/Hurd does have clock_gettime, it just doesn't define _POSIX_TIMERS because its support for timers is not complete.
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D158584
Added:
Modified:
libcxx/src/chrono.cpp
libcxx/src/filesystem/filesystem_clock.cpp
Removed:
################################################################################
diff --git a/libcxx/src/chrono.cpp b/libcxx/src/chrono.cpp
index 1247e42be67fb4..b31ef19c0a3dc7 100644
--- a/libcxx/src/chrono.cpp
+++ b/libcxx/src/chrono.cpp
@@ -31,7 +31,7 @@
# include <sys/time.h> // for gettimeofday and timeval
#endif
-#if defined(__APPLE__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
+#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
# define _LIBCPP_HAS_CLOCK_GETTIME
#endif
diff --git a/libcxx/src/filesystem/filesystem_clock.cpp b/libcxx/src/filesystem/filesystem_clock.cpp
index d00cdc6df3437c..fbb19ac68df55f 100644
--- a/libcxx/src/filesystem/filesystem_clock.cpp
+++ b/libcxx/src/filesystem/filesystem_clock.cpp
@@ -29,7 +29,7 @@
# include <sys/time.h> // for gettimeofday and timeval
#endif
-#if defined(__APPLE__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
+#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
# define _LIBCPP_HAS_CLOCK_GETTIME
#endif
More information about the libcxx-commits
mailing list