UDNS Windows compatibility changes
For some reason the config file doesn't generate with WINDOWS defined on my system.
This commit is contained in:
parent
a68c4e9434
commit
4f6e72de55
6
3rdparty/udns/udns_init.c
vendored
6
3rdparty/udns/udns_init.c
vendored
@ -24,7 +24,7 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#ifdef WINDOWS
|
||||
#if defined(_WINDOWS) || defined(WINDOWS)
|
||||
# include <winsock2.h> /* includes <windows.h> */
|
||||
# include <iphlpapi.h> /* 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...
|
||||
|
8
3rdparty/udns/udns_resolver.c
vendored
8
3rdparty/udns/udns_resolver.c
vendored
@ -24,7 +24,7 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#ifdef WINDOWS
|
||||
#if defined(_WINDOWS) || defined(WINDOWS)
|
||||
# include <winsock2.h> /* includes <windows.h> */
|
||||
# include <ws2tcpip.h> /* 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)
|
||||
|
2
3rdparty/udns/udns_rr_a.c
vendored
2
3rdparty/udns/udns_rr_a.c
vendored
@ -27,7 +27,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#ifndef WINDOWS
|
||||
#if !defined(_WINDOWS) && !defined(WINDOWS)
|
||||
# include <sys/types.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user