From c696492549e1750727fa0735c75c8aa090e534b7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 24 Oct 2014 17:39:15 -0400 Subject: unbound: fix getaddrinfo detection for 32-bit windows On Windows, getaddrinfo is part of the Windows API and as such is __stdcall, not __cdecl, so check_function_exists fails because the declaration doesn't match the mangling __stdcall has. Instead, use a header to include the symbol as declared on the system and use check_symbol_exists instead. Tested-By: greatwolf on IRC --- external/unbound/configure_checks.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'external') diff --git a/external/unbound/configure_checks.cmake b/external/unbound/configure_checks.cmake index b65b48c23..ead51e98f 100644 --- a/external/unbound/configure_checks.cmake +++ b/external/unbound/configure_checks.cmake @@ -59,7 +59,6 @@ check_function_exists(endservent HAVE_ENDSERVENT) check_function_exists(fnctl HAVE_FNCTL) check_function_exists(fork HAVE_FORK) check_function_exists(fseeko HAVE_FSEEKO) -check_function_exists(getaddrinfo HAVE_GETADDRINFO) check_function_exists(getentropy HAVE_GETENTROPY) check_function_exists(getpwnam HAVE_GETPWNAM) check_function_exists(getrlimit HAVE_GETRLIMIT) @@ -100,6 +99,17 @@ check_function_exists(usleep HAVE_USLEEP) check_function_exists(writev HAVE_WRITEV) check_function_exists(_beginthreadex HAVE__BEGINTHREADEX) +set(getaddrinfo_headers) +if (HAVE_NETDB_H) + list(APPEND getaddrinfo_headers "netdb.h") +endif () +if (HAVE_WS2TCPIP_H) + list(APPEND getaddrinfo_headers "ws2tcpip.h") +endif () +check_symbol_exists(getaddrinfo "${getaddrinfo_headers}" HAVE_GETADDRINFO) + +check_function_exists(getaddrinfo HAVE_GETADDRINFO) + function (check_type_exists type variable header default) set(CMAKE_EXTRA_INCLUDE_FILES "${header}") check_type_size("${type}" "${variable}") -- cgit v1.2.3