From 4f6e72de5543cbfdf3ee373e5a0238023ee72b89 Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Sat, 8 Jun 2019 15:49:15 +0200 Subject: [PATCH] UDNS Windows compatibility changes For some reason the config file doesn't generate with WINDOWS defined on my system. --- 3rdparty/udns/udns_init.c | 6 +++--- 3rdparty/udns/udns_resolver.c | 8 ++++---- 3rdparty/udns/udns_rr_a.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/3rdparty/udns/udns_init.c b/3rdparty/udns/udns_init.c index 493af589..c28d7c08 100644 --- a/3rdparty/udns/udns_init.c +++ b/3rdparty/udns/udns_init.c @@ -24,7 +24,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifdef WINDOWS +#if defined(_WINDOWS) || defined(WINDOWS) # include /* includes */ # include /* for dns server addresses etc */ #else @@ -53,7 +53,7 @@ static void dns_set_srch_internal(struct dns_ctx *ctx, char *srch) { dns_add_srch(ctx, srch); } -#ifdef WINDOWS +#if defined(_WINDOWS) || defined(WINDOWS) #ifndef NO_IPHLPAPI /* Apparently, some systems does not have proper headers for IPHLPAIP to work. @@ -217,7 +217,7 @@ int dns_init(struct dns_ctx *ctx, int do_open) { ctx = &dns_defctx; dns_reset(ctx); -#ifdef WINDOWS +#if defined(_WINDOWS) || defined(WINDOWS) if (dns_initns_iphlpapi(ctx) != 0) dns_initns_registry(ctx); /*XXX WINDOWS: probably good to get default domain and search list too... diff --git a/3rdparty/udns/udns_resolver.c b/3rdparty/udns/udns_resolver.c index b8f899a2..9f8b7503 100644 --- a/3rdparty/udns/udns_resolver.c +++ b/3rdparty/udns/udns_resolver.c @@ -24,7 +24,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifdef WINDOWS +#if defined(_WINDOWS) || defined(WINDOWS) # include /* includes */ # include /* needed for struct in6_addr */ #else @@ -392,7 +392,7 @@ dns_set_tmcbck(struct dns_ctx *ctx, dns_utm_fn *fn, void *data) { } static unsigned dns_nonrandom_32(void) { -#ifdef WINDOWS +#if defined(_WINDOWS) || defined(WINDOWS) FILETIME ft; GetSystemTimeAsFileTime(&ft); return ft.dwLowDateTime; @@ -551,7 +551,7 @@ int dns_open(struct dns_ctx *ctx) { ctx->dnsc_qstatus = DNS_E_TEMPFAIL; return -1; } -#ifdef WINDOWS +#if defined(_WINDOWS) || defined(WINDOWS) { unsigned long on = 1; if (ioctlsocket(sock, FIONBIO, &on) == SOCKET_ERROR) { closesocket(sock); @@ -991,7 +991,7 @@ again: /* receive the reply */ * or remote. On local errors, we should stop, while * remote errors should be ignored (for now anyway). */ -#ifdef WINDOWS +#if defined(_WINDOWS) || defined(WINDOWS) if (WSAGetLastError() == WSAEWOULDBLOCK) #else if (errno == EAGAIN) diff --git a/3rdparty/udns/udns_rr_a.c b/3rdparty/udns/udns_rr_a.c index 72cd2022..4492d049 100644 --- a/3rdparty/udns/udns_rr_a.c +++ b/3rdparty/udns/udns_rr_a.c @@ -27,7 +27,7 @@ #include #include #include -#ifndef WINDOWS +#if !defined(_WINDOWS) && !defined(WINDOWS) # include # include #endif