Skip to content

Commit 0ec768e

Browse files
sthibaultru
authored andcommitted
[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 (cherry picked from commit 1cfcc36)
1 parent ef7421f commit 0ec768e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libcxx/src/chrono.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# include <sys/time.h> // for gettimeofday and timeval
3232
#endif
3333

34-
#if defined(__APPLE__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
34+
#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
3535
# define _LIBCPP_HAS_CLOCK_GETTIME
3636
#endif
3737

libcxx/src/filesystem/filesystem_clock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# include <sys/time.h> // for gettimeofday and timeval
3030
#endif
3131

32-
#if defined(__APPLE__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
32+
#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
3333
# define _LIBCPP_HAS_CLOCK_GETTIME
3434
#endif
3535

0 commit comments

Comments
 (0)