[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
This commit is contained in:
Samuel Thibault 2023-08-25 19:53:20 +02:00 committed by Mark de Wever
parent 9300b6de3c
commit 1cfcc36812
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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