mirror of https://github.com/getdnsapi/getdns.git
Add test for new libuv callback styles.
This fixes a build warning on Mac.
This commit is contained in:
parent
4314f5dbf9
commit
277a4ae9c7
|
@ -794,6 +794,12 @@ endif ()
|
|||
if (USE_LIBUV)
|
||||
find_package(Libuv)
|
||||
if (Libuv_FOUND)
|
||||
# Check for new-style callbacks.
|
||||
try_compile(HAVE_NEW_UV_TIMER_CB
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test_uv_cb.c
|
||||
)
|
||||
|
||||
# Copy module header to getdns include dir.
|
||||
file(COPY src/getdns/getdns_ext_libuv.h DESTINATION getdns)
|
||||
|
||||
|
|
|
@ -207,6 +207,8 @@
|
|||
|
||||
#cmakedefine USE_OSX_TCP_FASTOPEN 1
|
||||
|
||||
#cmakedefine HAVE_NEW_UV_TIMER_CB 1
|
||||
|
||||
#cmakedefine HAVE_TARGET_ENDIANNESS
|
||||
#cmakedefine TARGET_IS_BIG_ENDIAN
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#include <uv.h>
|
||||
|
||||
void test_cb(uv_timer_t *handle)
|
||||
{
|
||||
(void) handle;
|
||||
}
|
||||
|
||||
int main(int ac, char *av[])
|
||||
{
|
||||
uv_timer_cb cb = test_cb;
|
||||
(*cb)(0);
|
||||
}
|
Loading…
Reference in New Issue