forked from OSchip/llvm-project
[libc++] chrono: check _POSIX_TIMERS before using clock_gettime
clock_gettime is documented to be available when _POSIX_TIMERS is defined. Add a check for this. Differential Revision: https://reviews.llvm.org/D79305
This commit is contained in:
parent
34a57dc972
commit
59b3102739
|
@ -12,9 +12,13 @@
|
|||
#include <time.h> // clock_gettime, CLOCK_MONOTONIC and CLOCK_REALTIME
|
||||
#include "include/apple_availability.h"
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && _POSIX_TIMERS > 0
|
||||
#define _LIBCPP_USE_CLOCK_GETTIME
|
||||
#endif // __APPLE__
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_WIN32API)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
|
|
@ -36,7 +36,11 @@
|
|||
#define _LIBCPP_USE_COPYFILE
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && _POSIX_TIMERS > 0
|
||||
#define _LIBCPP_USE_CLOCK_GETTIME
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue