Initial fixes from John to compile getdns on Windows

This commit is contained in:
Willem Toorop 2017-09-14 12:25:25 +02:00
parent 22d1345491
commit 836c651539
2 changed files with 10 additions and 3 deletions

View File

@ -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 <sys/select.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

View File

@ -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)
{