mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-11-27 01:50:28 +00:00
Merge pull request #1915 from nghttp2/fix-build-without-libev
Fix build error without libev
This commit is contained in:
commit
2c955ab76b
@ -90,3 +90,6 @@
|
||||
|
||||
/* Define to 1 if you have `libngtcp2_crypto_openssl` library. */
|
||||
#cmakedefine HAVE_LIBNGTCP2_CRYPTO_OPENSSL
|
||||
|
||||
/* Define to 1 if you have `libev` library. */
|
||||
#cmakedefine HAVE_LIBEV 1
|
||||
|
@ -433,6 +433,10 @@ if test "x${request_libev}" != "xno"; then
|
||||
else
|
||||
have_libev=yes
|
||||
fi
|
||||
|
||||
if test "x${have_libev}" = "xyes"; then
|
||||
AC_DEFINE([HAVE_LIBEV], [1], [Define to 1 if you have `libev` library.])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x${request_libev}" = "xyes" &&
|
||||
|
@ -47,7 +47,9 @@
|
||||
#include <map>
|
||||
#include <random>
|
||||
|
||||
#include <ev.h>
|
||||
#ifdef HAVE_LIBEV
|
||||
# include <ev.h>
|
||||
#endif // HAVE_LIBEV
|
||||
|
||||
#include "url-parser/url_parser.h"
|
||||
|
||||
@ -697,6 +699,7 @@ template <typename Clock, typename Rep> Rep clock_precision() {
|
||||
return duration.count();
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBEV
|
||||
template <typename Duration = std::chrono::steady_clock::duration>
|
||||
Duration duration_from(ev_tstamp d) {
|
||||
return std::chrono::duration_cast<Duration>(std::chrono::duration<double>(d));
|
||||
@ -705,6 +708,7 @@ Duration duration_from(ev_tstamp d) {
|
||||
template <typename Duration> ev_tstamp ev_tstamp_from(const Duration &d) {
|
||||
return std::chrono::duration<double>(d).count();
|
||||
}
|
||||
#endif // HAVE_LIBEV
|
||||
|
||||
int make_socket_closeonexec(int fd);
|
||||
int make_socket_nonblocking(int fd);
|
||||
|
Loading…
Reference in New Issue
Block a user