[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