mirror of
https://github.com/isc-projects/bind9.git
synced 2026-07-16 23:44:14 -04:00
Add uv_req_get_data() and uv_req_set_data() compatibility shims
The uv_req_get_data() and uv_req_set_data() functions were introduced in libuv >= 1.19.0, so we need to add compatibility shims with older libuv versions.
This commit is contained in:
parent
7b02848865
commit
f752840db3
3 changed files with 23 additions and 1 deletions
|
|
@ -384,6 +384,12 @@ typedef __int64 off_t;
|
|||
/* Define to 1 if you have the `uv_handle_set_data' function. */
|
||||
#define HAVE_UV_HANDLE_SET_DATA 1
|
||||
|
||||
/* Define to 1 if you have the `uv_req_get_data' function. */
|
||||
#define HAVE_UV_REQ_GET_DATA 1
|
||||
|
||||
/* Define to 1 if you have the `uv_req_set_data' function. */
|
||||
#define HAVE_UV_REQ_SET_DATA 1
|
||||
|
||||
/* GSSAPI Related defines */
|
||||
@HAVE_GSSAPI@
|
||||
@HAVE_GSSAPI_H@
|
||||
|
|
|
|||
|
|
@ -600,7 +600,9 @@ LIBS="$LIBS $LIBUV_LIBS"
|
|||
|
||||
# Those functions are only provided in newer versions of libuv, we'll be emulating them
|
||||
# for now
|
||||
AC_CHECK_FUNCS([uv_handle_get_data uv_handle_set_data uv_udp_connect uv_translate_sys_error uv_sleep])
|
||||
AC_CHECK_FUNCS([uv_handle_get_data uv_handle_set_data])
|
||||
AC_CHECK_FUNCS([uv_req_get_data uv_req_set_data])
|
||||
AC_CHECK_FUNCS([uv_udp_connect uv_translate_sys_error uv_sleep])
|
||||
AX_RESTORE_FLAGS([libuv])
|
||||
|
||||
# libnghttp2
|
||||
|
|
|
|||
|
|
@ -33,6 +33,20 @@ uv_handle_set_data(uv_handle_t *handle, void *data) {
|
|||
}
|
||||
#endif /* ifndef HAVE_UV_HANDLE_SET_DATA */
|
||||
|
||||
#ifndef HAVE_UV_REQ_GET_DATA
|
||||
static inline void *
|
||||
uv_req_get_data(const uv_req_t *req) {
|
||||
return (req->data);
|
||||
}
|
||||
#endif /* ifndef HAVE_UV_REQ_GET_DATA */
|
||||
|
||||
#ifndef HAVE_UV_REQ_SET_DATA
|
||||
static inline void
|
||||
uv_req_set_data(uv_req_t *req, void *data) {
|
||||
req->data = data;
|
||||
}
|
||||
#endif /* ifndef HAVE_UV_REQ_SET_DATA */
|
||||
|
||||
#ifndef HAVE_UV_SLEEP
|
||||
#define uv_sleep(msec) usleep(msec * 1000)
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue