commit | 1bd707aa2fd74a2eb18ba5fb5782361a94fd92e7 | [log] [tgz] |
---|---|---|
author | Mara Sophie Grosch <littlefox@lf-net.org> | Thu May 07 12:10:33 2020 -0400 |
committer | Louis Dionne <ldionne@apple.com> | Thu May 07 13:15:10 2020 -0400 |
tree | e2a9ef991411e18fd8f1f1fe830ed994fab4b508 | |
parent | feb783e7b95c99244f741b5b8ba96282d90ca58a [diff] |
[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 Cr-Mirrored-From: https://chromium.googlesource.com/external/github.com/llvm/llvm-project Cr-Mirrored-Commit: 59b3102739c5988c9fc7ea77888de1bc8ce9c8ab
diff --git a/src/filesystem/operations.cpp b/src/filesystem/operations.cpp index 876399f..2c91ffd 100644 --- a/src/filesystem/operations.cpp +++ b/src/filesystem/operations.cpp
@@ -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