mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-11-26 17:40:25 +00:00
Prefer clock_gettime if __CYGWIN__ defined
This commit is contained in:
parent
c16e5ad42e
commit
c7536993cf
@ -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,9 @@ static uint64_t time_now_sec(void) {
|
||||
|
||||
return (uint64_t)t;
|
||||
}
|
||||
#endif /* HAVE_GETTICKCOUNT64 */
|
||||
#endif /* !HAVE_GETTICKCOUNT64 || __CYGWIN__ */
|
||||
|
||||
#ifdef HAVE_GETTICKCOUNT64
|
||||
#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) {
|
||||
@ -57,6 +57,6 @@ uint64_t nghttp2_time_now_sec(void) {
|
||||
|
||||
return (uint64_t)tp.tv_sec;
|
||||
}
|
||||
#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 */
|
||||
|
Loading…
Reference in New Issue
Block a user