Commit a0ee7149 authored by Ghislain MARY's avatar Ghislain MARY

Use fixed nameservers when cross-compiling for Windows.

parent 4e8baaaf
......@@ -27,7 +27,9 @@ LT_INIT(win32-dll)
dnl Workaround for mingw, whose compiler doesn't check in /usr/include ...
case "$target_os" in
*mingw*)
if test "$cross_compiling" != "yes"; then
if test "$cross_compiling" = "yes"; then
CPPFLAGS="$CPPFLAGS -DUSE_FIXED_NAMESERVERS"
else
if test "$prefix" = "/usr" ; then
CPPFLAGS="$CPPFLAGS -I/usr/include"
LDFLAGS="$LDFLAGS -L/usr/lib"
......
......@@ -72,7 +72,14 @@
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#ifndef WINAPI_FAMILY_PHONE_APP
#ifndef USE_FIXED_NAMESERVERS
#if WINAPI_FAMILY_PHONE_APP
#define USE_FIXED_NAMESERVERS 1
#else
#define USE_FIXED_NAMESERVERS 0
#endif
#endif
#if !USE_FIXED_NAMESERVERS
#include <IPHlpApi.h>
#pragma comment(lib, "IPHLPAPI.lib")
#endif
......@@ -840,7 +847,7 @@ static int dns_poll(int fd, short events, int timeout) {
fd_set rset, wset;
struct timeval tv = { timeout, 0 };
#if WINAPI_FAMILY_PHONE_APP
#if USE_FIXED_NAMESERVERS
return 0;
#endif
......@@ -4182,7 +4189,7 @@ int dns_resconf_loadpath(struct dns_resolv_conf *resconf, const char *path) {
#ifdef _WIN32
int dns_resconf_loadwin(struct dns_resolv_conf *resconf) {
#ifdef WINAPI_FAMILY_PHONE_APP
#if USE_FIXED_NAMESERVERS
const char * const nameservers[] = {
"8.8.8.8",
"8.8.4.4"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment