aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/nghttp2/lib/nghttp2_time.c
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2023-11-11 09:50:05 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2023-11-11 10:05:04 +0300
commit154c603a2ef249ddb80e5905ffd4ac35c9747d63 (patch)
treef57d45085c40b19ddc4df4be93a38f88d674a87a /contrib/libs/nghttp2/lib/nghttp2_time.c
parentc9eb66546bc5c72ff6a4424f5c73ada67d0aeaa8 (diff)
downloadydb-154c603a2ef249ddb80e5905ffd4ac35c9747d63.tar.gz
Update contrib/libs/nghttp2 to 1.58.0
Diffstat (limited to 'contrib/libs/nghttp2/lib/nghttp2_time.c')
-rw-r--r--contrib/libs/nghttp2/lib/nghttp2_time.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/libs/nghttp2/lib/nghttp2_time.c b/contrib/libs/nghttp2/lib/nghttp2_time.c
index 2a5f1a6ff5..897556fe2c 100644
--- a/contrib/libs/nghttp2/lib/nghttp2_time.c
+++ b/contrib/libs/nghttp2/lib/nghttp2_time.c
@@ -32,7 +32,7 @@
# include <sysinfoapi.h>
#endif /* HAVE_SYSINFOAPI_H */
-#ifndef HAVE_GETTICKCOUNT64
+#if !defined(HAVE_GETTICKCOUNT64) || defined(__CYGWIN__)
static uint64_t time_now_sec(void) {
time_t t = time(NULL);
@@ -42,9 +42,11 @@ static uint64_t time_now_sec(void) {
return (uint64_t)t;
}
-#endif /* HAVE_GETTICKCOUNT64 */
+#endif /* !HAVE_GETTICKCOUNT64 || __CYGWIN__ */
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_GETTICKCOUNT64) && !defined(__CYGWIN__)
+uint64_t nghttp2_time_now_sec(void) { return GetTickCount64() / 1000; }
+#elif defined(HAVE_CLOCK_GETTIME)
uint64_t nghttp2_time_now_sec(void) {
struct timespec tp;
int rv = clock_gettime(CLOCK_MONOTONIC, &tp);
@@ -55,8 +57,6 @@ uint64_t nghttp2_time_now_sec(void) {
return (uint64_t)tp.tv_sec;
}
-#elif defined(HAVE_GETTICKCOUNT64)
-uint64_t nghttp2_time_now_sec(void) { return GetTickCount64() / 1000; }
-#else /* !HAVE_CLOCK_GETTIME && !HAVE_GETTICKCOUNT64 */
+#else /* (!HAVE_CLOCK_GETTIME || __CYGWIN__) && !HAVE_GETTICKCOUNT64 */
uint64_t nghttp2_time_now_sec(void) { return time_now_sec(); }
-#endif /* !HAVE_CLOCK_GETTIME && !HAVE_GETTICKCOUNT64 */
+#endif /* (!HAVE_CLOCK_GETTIME || __CYGWIN__) && !HAVE_GETTICKCOUNT64 */