diff --git a/configure.ac b/configure.ac index 80d64aaa..55648094 100644 --- a/configure.ac +++ b/configure.ac @@ -233,7 +233,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) @@ -596,6 +596,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], @@ -1332,9 +1354,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 @@ -1361,6 +1386,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) { diff --git a/stubby b/stubby index 61142309..6d97f432 160000 --- a/stubby +++ b/stubby @@ -1 +1 @@ -Subproject commit 6114230904d9413514d521358ca7956aac99e822 +Subproject commit 6d97f4323f2706a2dfcffc7172bd3f71223974a8