From 836c6515399c488428ef4837f4703ac7b45ecb40 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 14 Sep 2017 12:25:25 +0200 Subject: [PATCH 1/4] Initial fixes from John to compile getdns on Windows --- configure.ac | 11 +++++++++-- src/extension/select_eventloop.c | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 4eea1694..16c64d90 100644 --- a/configure.ac +++ b/configure.ac @@ -232,7 +232,7 @@ esac DEFAULT_EVENTLOOP=select_eventloop -AC_CHECK_HEADERS([sys/poll.h poll.h sys/resource.h],,, [AC_INCLUDES_DEFAULT]) +AC_CHECK_HEADERS([sys/poll.h poll.h sys/resource.h sys/types.h],,, [AC_INCLUDES_DEFAULT]) AC_ARG_ENABLE(poll-eventloop, AC_HELP_STRING([--disable-poll-eventloop], [Disable default eventloop based on poll (default=enabled if available)])) case "$enable_poll_eventloop" in no) @@ -1286,9 +1286,12 @@ const char *inet_ntop(int af, const void *src, char *dst, size_t size); #endif #ifdef USE_WINSOCK +# ifndef _CUSTOM_VSNPRINTF +# define _CUSTOM_VSNPRINTF static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *format, va_list ap) { int r = vsnprintf(str, size, format, ap); return r == -1 ? _vscprintf(format, ap) : r; } -# define vsnprintf _gldns_custom_vsnprintf +# define vsnprintf _gldns_custom_vsnprintf +# endif #endif #ifdef __cplusplus @@ -1315,6 +1318,10 @@ static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *fo #include #endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif + #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/src/extension/select_eventloop.c b/src/extension/select_eventloop.c index 47769afd..348c7ab1 100644 --- a/src/extension/select_eventloop.c +++ b/src/extension/select_eventloop.c @@ -27,9 +27,9 @@ #include "config.h" -#include "extension/select_eventloop.h" #include "debug.h" #include "types-internal.h" +#include "extension/select_eventloop.h" static uint64_t get_now_plus(uint64_t amount) { From 96c6e49ae5ffa4f351d1c71f0369e09ce405b3ca Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 14 Sep 2017 15:26:40 +0200 Subject: [PATCH 2/4] Use the on windows compilable stubby --- stubby | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubby b/stubby index 61142309..9f73cacf 160000 --- a/stubby +++ b/stubby @@ -1 +1 @@ -Subproject commit 6114230904d9413514d521358ca7956aac99e822 +Subproject commit 9f73cacf3b85e85c2b459543442d33a7660fce2d From 89809291509768d88c0c9863b3cbedbbcc616826 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 14 Sep 2017 17:16:54 +0200 Subject: [PATCH 3/4] Check whether -D_POSIX is needed for sigset_t --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/configure.ac b/configure.ac index 16c64d90..accad7c0 100644 --- a/configure.ac +++ b/configure.ac @@ -584,6 +584,28 @@ if test "$USE_WINSOCK" = 1; then LIBS="$LIBS -lgdi32 -liphlpapi" fi +dnl Check if -D_POSIX is needed for sigset_t + +AC_CHECK_TYPE([sigset_t], [ + AC_MSG_NOTICE(-D_POSIX is NOT needed for the sigset_t type) +], [ + BACKCFLAGS="$CFLAGS" + CFLAGS="-D_POSIX $CFLAGS" + AC_CHECK_TYPE([sigset_t], [ + AC_MSG_NOTICE(-D_POSIX is needed for the sigset_t type) + ], [ + AC_MSG_NOTICE(Unclear whether -D_POSIX is needed for the sigset_t type) + BACKCFLAGS="$CFLAGS" + ], [AC_INCLUDES_DEFAULT +#ifdef HAVE_SYS_TYPES_H +#include +#endif + ]) +], [AC_INCLUDES_DEFAULT +#ifdef HAVE_SYS_TYPES_H +#include +#endif +]) my_with_libidn=1 AC_ARG_WITH(libidn, AS_HELP_STRING([--with-libidn=pathname], From 40295075adecf907bf65da0865b90c5e2e4fa742 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 14 Sep 2017 17:34:39 +0200 Subject: [PATCH 4/4] Update stubby submodule --- stubby | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubby b/stubby index 9f73cacf..6d97f432 160000 --- a/stubby +++ b/stubby @@ -1 +1 @@ -Subproject commit 9f73cacf3b85e85c2b459543442d33a7660fce2d +Subproject commit 6d97f4323f2706a2dfcffc7172bd3f71223974a8