aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-10-24 17:39:15 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2014-10-24 17:40:52 -0400
commitc696492549e1750727fa0735c75c8aa090e534b7 (patch)
tree59e7014af017f24fa277a29eccc38e219636a665
parentcmake: Windows and static builds need this (diff)
downloadmonero-c696492549e1750727fa0735c75c8aa090e534b7.tar.xz
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
-rw-r--r--external/unbound/configure_checks.cmake12
1 files changed, 11 insertions, 1 deletions
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}")