Fix Watt-32 compilation support (#781)

Watt-32 (https://www.watt-32.net/) support has been broken for a long
time. Patch c-ares to fix Watt-32 support and also gets rid of the
`WIN32` macro which adds confusion, only use `USE_WINSOCK` macro.

Add a CI/CD task to build c-ares on Windows using MSVC with Watt-32.

Fixes Issue: #780
Fix By: Brad House (@bradh352)
pull/775/head
Brad House 6 months ago committed by GitHub
parent 9d36fd2030
commit f527554c7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .github/workflows/coverity.yml
  2. 7
      .github/workflows/watcom.yml
  3. 51
      .github/workflows/watt32.yml
  4. 2
      Makefile.Watcom
  5. 13
      Makefile.msvc
  6. 25
      include/ares.h
  7. 4
      src/lib/ares__addrinfo2hostent.c
  8. 9
      src/lib/ares__addrinfo_localhost.c
  9. 4
      src/lib/ares__buf.c
  10. 4
      src/lib/ares__buf.h
  11. 2
      src/lib/ares__hosts_file.c
  12. 2
      src/lib/ares__socket.c
  13. 2
      src/lib/ares__timeval.c
  14. 4
      src/lib/ares_event_configchg.c
  15. 4
      src/lib/ares_event_thread.c
  16. 2
      src/lib/ares_event_win32.c
  17. 5
      src/lib/ares_getaddrinfo.c
  18. 4
      src/lib/ares_gethostbyaddr.c
  19. 5
      src/lib/ares_init.c
  20. 2
      src/lib/ares_library_init.c
  21. 4
      src/lib/ares_platform.c
  22. 2
      src/lib/ares_platform.h
  23. 10
      src/lib/ares_private.h
  24. 12
      src/lib/ares_setup.h
  25. 9
      src/lib/ares_sysconfig.c
  26. 15
      src/lib/config-win32.h
  27. 5
      src/lib/setup_once.h
  28. 2
      src/lib/windows_port.c
  29. 5
      src/tools/adig.c
  30. 2
      src/tools/ahost.c

@ -13,8 +13,6 @@ jobs:
steps: steps:
- name: Checkout Source - name: Checkout Source
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: apt dependencies - name: apt dependencies
run: sudo apt-get install cmake ninja-build run: sudo apt-get install cmake ninja-build
- name: Download Coverity Build Tool - name: Download Coverity Build Tool

@ -3,11 +3,8 @@
name: OpenWatcom name: OpenWatcom
on: on:
push: push:
branches:
- main
pull_request: pull_request:
branches:
- main
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
@ -15,8 +12,6 @@ jobs:
- uses: open-watcom/setup-watcom@v0 - uses: open-watcom/setup-watcom@v0
- name: Checkout Source - name: Checkout Source
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: configure - name: configure
run: buildconf.bat run: buildconf.bat
shell: cmd shell: cmd

@ -0,0 +1,51 @@
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
name: WATT32
on:
push:
pull_request:
jobs:
build:
runs-on: windows-latest
env:
WATT_ROOT: "${{ github.workspace }}\\watt-32"
steps:
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Checkout c-ares
uses: actions/checkout@v4
- name: Checkout Watt-32
uses: actions/checkout@v4
with:
repository: gvanem/Watt-32
path: watt-32
- name: "Watt-32: Make sure lang.c timestamp is ahead of checkout time so it doesn't try to rebuild and fail"
run: (Get-ChildItem "watt-32/src/lang.c").LastWriteTime = Get-Date
- name: Build Watt-32
run: |
cd watt-32\src
& .\configur.bat visualc
echo "Configured"
nmake -nologo -f visualc-release_32.mak
# Powershell doesn't preserve environment variables set by configur.bat
env:
MKMAKE: ..\util\win32\mkmake.exe
MKDEP: ..\util\win32\mkdep.exe
HC_ERR: ..\util\win32\hc_err.exe
WC_ERR: ..\util\win32\wc_err.exe
BCC_ERR: ..\util\win32\bcc_err.exe
W32_BIN2C: ..\util\win32\bin2c.exe
W32_BIN2C_: ../util/win32/bin2c.exe
W32_NASM: ..\util\win32\nasm.exe
W32_NASM_: ../util/win32/nasm.exe
DJ_ERR: ..\util\win32\dj_err.exe
- name: Build c-ares
run: |
Copy-Item "include\ares_build.h.dist" -Destination "include\ares_build.h"
nmake USE_WATT32=1 CFG=dll-release /NOLOGO /f .\Makefile.msvc
nmake USE_WATT32=1 CFG=lib-release /NOLOGO /f .\Makefile.msvc

@ -42,7 +42,7 @@ RD = rmdir /q /s 2>NUL
CP = copy CP = copy
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -aa & CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -aa &
-wcd=201 -bt=nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY & -wcd=201 -bt=nt -d+ -dCARES_BUILDING_LIBRARY &
-dNTDDI_VERSION=0x06020000 -I. -I.\include -I.\src\lib $(SYS_INCL) -dNTDDI_VERSION=0x06020000 -I. -I.\include -I.\src\lib $(SYS_INCL)
LFLAGS = option quiet, map, caseexact, eliminate LFLAGS = option quiet, map, caseexact, eliminate

@ -71,7 +71,9 @@ RTLIBD = /MTd
# otherwise Winsock tcp/ip stack will be used as default. # otherwise Winsock tcp/ip stack will be used as default.
# -------------------------------------------------------- # --------------------------------------------------------
!IFNDEF USE_WATT32
USE_WATT32 = 0 USE_WATT32 = 0
!ENDIF
# -------------------------------------------------------- # --------------------------------------------------------
# Detect compiler version. # Detect compiler version.
@ -176,11 +178,14 @@ PROG3_OBJDIR = $(PROG3_OUTDIR)\obj
# ------------------------------------- # -------------------------------------
!IF "$(USE_WATT32)" == "1" !IF "$(USE_WATT32)" == "1"
CFLAGS = /UWIN32 /DWATT32 /I$(WATT_ROOT)\inc CFLAGS = /D_WIN32_WINNT=0x0602 /DWATT32 /I$(WATT_ROOT)\inc
EX_LIBS_REL = $(WATT_ROOT)\lib\wattcpvc_imp.lib ! IFNDEF PLATFORM
EX_LIBS_DBG = $(WATT_ROOT)\lib\wattcpvc_imp_d.lib PLATFORM = x86
! ENDIF
EX_LIBS_REL = $(WATT_ROOT)\lib\$(PLATFORM)\wattcpvc_imp.lib advapi32.lib
EX_LIBS_DBG = $(WATT_ROOT)\lib\$(PLATFORM)\wattcpvc_imp_d.lib advapi32.lib
!ELSE !ELSE
CFLAGS = /DWIN32 /D_WIN32_WINNT=0x0602 CFLAGS = /D_WIN32_WINNT=0x0602
EX_LIBS_REL = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib EX_LIBS_REL = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib
EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib iphlpapi.lib
!ENDIF !ENDIF

@ -32,15 +32,6 @@
#include "ares_build.h" /* c-ares build definitions */ #include "ares_build.h" /* c-ares build definitions */
#include "ares_rules.h" /* c-ares rules enforcement */ #include "ares_rules.h" /* c-ares rules enforcement */
/*
* Define WIN32 when build target is Win32 API
*/
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && \
!defined(__SYMBIAN32__)
# define WIN32
#endif
#include <sys/types.h> #include <sys/types.h>
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
@ -56,20 +47,20 @@
# include <sys/bsdskt.h> # include <sys/bsdskt.h>
#endif #endif
#if defined(_WIN32)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
#endif
#if defined(WATT32) #if defined(WATT32)
# include <netinet/in.h> # include <netinet/in.h>
# include <sys/socket.h> # include <sys/socket.h>
# include <tcp.h> # include <tcp.h>
#elif defined(_WIN32_WCE) #elif defined(_WIN32_WCE)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h> # include <windows.h>
# include <winsock.h> # include <winsock.h>
#elif defined(WIN32) #elif defined(_WIN32)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h> # include <windows.h>
# include <winsock2.h> # include <winsock2.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>
@ -315,7 +306,7 @@ typedef enum {
*/ */
#ifndef ares_socket_typedef #ifndef ares_socket_typedef
# ifdef WIN32 # if defined(_WIN32) && !defined(WATT32)
typedef SOCKET ares_socket_t; typedef SOCKET ares_socket_t;
# define ARES_SOCKET_BAD INVALID_SOCKET # define ARES_SOCKET_BAD INVALID_SOCKET
# else # else

@ -39,8 +39,6 @@
# include <arpa/inet.h> # include <arpa/inet.h>
#endif #endif
#include "ares_nameser.h"
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif #endif
@ -50,8 +48,6 @@
#endif #endif
#include "ares.h" #include "ares.h"
#include "ares_dns.h"
#include "ares_inet_net_pton.h"
#include "ares_private.h" #include "ares_private.h"
ares_status_t ares__addrinfo2hostent(const struct ares_addrinfo *ai, int family, ares_status_t ares__addrinfo2hostent(const struct ares_addrinfo *ai, int family,

@ -37,11 +37,10 @@
# include <arpa/inet.h> # include <arpa/inet.h>
#endif #endif
#if defined(_WIN32) && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600
# include <ws2ipdef.h>
#endif
#if defined(USE_WINSOCK) #if defined(USE_WINSOCK)
# if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600
# include <ws2ipdef.h>
# endif
# if defined(HAVE_IPHLPAPI_H) # if defined(HAVE_IPHLPAPI_H)
# include <iphlpapi.h> # include <iphlpapi.h>
# endif # endif
@ -137,7 +136,7 @@ static ares_status_t
ares__system_loopback_addrs(int aftype, unsigned short port, ares__system_loopback_addrs(int aftype, unsigned short port,
struct ares_addrinfo_node **nodes) struct ares_addrinfo_node **nodes)
{ {
#if defined(_WIN32) && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600 && \ #if defined(USE_WINSOCK) && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600 && \
!defined(__WATCOMC__) !defined(__WATCOMC__)
PMIB_UNICASTIPADDRESS_TABLE table; PMIB_UNICASTIPADDRESS_TABLE table;
unsigned int i; unsigned int i;

@ -229,9 +229,9 @@ ares_status_t ares__buf_append(ares__buf_t *buf, const unsigned char *data,
return ARES_SUCCESS; return ARES_SUCCESS;
} }
ares_status_t ares__buf_append_byte(ares__buf_t *buf, unsigned char byte) ares_status_t ares__buf_append_byte(ares__buf_t *buf, unsigned char b)
{ {
return ares__buf_append(buf, &byte, 1); return ares__buf_append(buf, &b, 1);
} }
ares_status_t ares__buf_append_be16(ares__buf_t *buf, unsigned short u16) ares_status_t ares__buf_append_be16(ares__buf_t *buf, unsigned short u16)

@ -85,10 +85,10 @@ ares_status_t ares__buf_append(ares__buf_t *buf, const unsigned char *data,
/*! Append a single byte to the dynamic buffer object /*! Append a single byte to the dynamic buffer object
* *
* \param[in] buf Initialized buffer object * \param[in] buf Initialized buffer object
* \param[in] byte Single byte to append to buffer object. * \param[in] b Single byte to append to buffer object.
* \return ARES_SUCCESS or one of the c-ares error codes * \return ARES_SUCCESS or one of the c-ares error codes
*/ */
ares_status_t ares__buf_append_byte(ares__buf_t *buf, unsigned char byte); ares_status_t ares__buf_append_byte(ares__buf_t *buf, unsigned char b);
/*! Append a null-terminated string to the dynamic buffer object /*! Append a null-terminated string to the dynamic buffer object
* *

@ -658,7 +658,7 @@ static ares_status_t ares__hosts_path(const ares_channel_t *channel,
} }
if (!path_hosts) { if (!path_hosts) {
#ifdef WIN32 #if defined(USE_WINSOCK)
char PATH_HOSTS[MAX_PATH] = ""; char PATH_HOSTS[MAX_PATH] = "";
char tmp[MAX_PATH]; char tmp[MAX_PATH];
HKEY hkeyHosts; HKEY hkeyHosts;

@ -145,7 +145,7 @@ static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
#endif #endif
} }
#if defined(IPV6_V6ONLY) && defined(WIN32) #if defined(IPV6_V6ONLY) && defined(USE_WINSOCK)
/* It makes support for IPv4-mapped IPv6 addresses. /* It makes support for IPv4-mapped IPv6 addresses.
* Linux kernel, NetBSD, FreeBSD and Darwin: default is off; * Linux kernel, NetBSD, FreeBSD and Darwin: default is off;
* Windows Vista and later: default is on; * Windows Vista and later: default is on;

@ -28,7 +28,7 @@
#include "ares.h" #include "ares.h"
#include "ares_private.h" #include "ares_private.h"
#if defined(WIN32) && !defined(MSDOS) #if defined(_WIN32) && !defined(MSDOS)
ares_timeval_t ares__tvnow(void) ares_timeval_t ares__tvnow(void)
{ {

@ -173,7 +173,7 @@ done:
return status; return status;
} }
#elif defined(_WIN32) #elif defined(USE_WINSOCK)
# include <winsock2.h> # include <winsock2.h>
# include <iphlpapi.h> # include <iphlpapi.h>
@ -388,7 +388,7 @@ done:
return status; return status;
} }
#elif defined(HAVE_STAT) #elif defined(HAVE_STAT) && !defined(_WIN32)
# ifdef HAVE_SYS_TYPES_H # ifdef HAVE_SYS_TYPES_H
# include <sys/types.h> # include <sys/types.h>
# endif # endif

@ -355,7 +355,7 @@ static const ares_event_sys_t *ares_event_fetch_sys(ares_evsys_t evsys)
{ {
switch (evsys) { switch (evsys) {
case ARES_EVSYS_WIN32: case ARES_EVSYS_WIN32:
#if defined(_WIN32) #if defined(USE_WINSOCK)
return &ares_evsys_win32; return &ares_evsys_win32;
#else #else
return NULL; return NULL;
@ -391,7 +391,7 @@ static const ares_event_sys_t *ares_event_fetch_sys(ares_evsys_t evsys)
/* case ARES_EVSYS_DEFAULT: */ /* case ARES_EVSYS_DEFAULT: */
default: default:
#if defined(_WIN32) #if defined(USE_WINSOCK)
return &ares_evsys_win32; return &ares_evsys_win32;
#elif defined(HAVE_KQUEUE) #elif defined(HAVE_KQUEUE)
return &ares_evsys_kqueue; return &ares_evsys_kqueue;

@ -33,7 +33,7 @@
# include <limits.h> # include <limits.h>
#endif #endif
#ifdef _WIN32 #if defined(USE_WINSOCK)
/* IMPLEMENTATION NOTES /* IMPLEMENTATION NOTES
* ==================== * ====================

@ -60,10 +60,7 @@
#include "ares_private.h" #include "ares_private.h"
#include "ares_dns.h" #include "ares_dns.h"
#ifdef WATT32 #ifdef _WIN32
# undef WIN32
#endif
#ifdef WIN32
# include "ares_platform.h" # include "ares_platform.h"
#endif #endif

@ -44,10 +44,6 @@
#include "ares_platform.h" #include "ares_platform.h"
#include "ares_private.h" #include "ares_private.h"
#ifdef WATT32
# undef WIN32
#endif
struct addr_query { struct addr_query {
/* Arguments passed to ares_gethostbyaddr() */ /* Arguments passed to ares_gethostbyaddr() */
ares_channel_t *channel; ares_channel_t *channel;

@ -67,11 +67,6 @@
#include "ares_private.h" #include "ares_private.h"
#include "ares_event.h" #include "ares_event.h"
#ifdef WATT32
# undef WIN32 /* Redefined in MingW/MSVC headers */
#endif
int ares_init(ares_channel_t **channelptr) int ares_init(ares_channel_t **channelptr)
{ {
return ares_init_options(channelptr, NULL, 0); return ares_init_options(channelptr, NULL, 0);

@ -55,7 +55,7 @@ static void *default_malloc(size_t size)
return malloc(size); return malloc(size);
} }
#if defined(WIN32) #if defined(_WIN32)
/* We need indirections to handle Windows DLL rules. */ /* We need indirections to handle Windows DLL rules. */
static void *default_realloc(void *p, size_t size) static void *default_realloc(void *p, size_t size)
{ {

@ -31,7 +31,7 @@
#include "ares_platform.h" #include "ares_platform.h"
#include "ares_private.h" #include "ares_private.h"
#if defined(WIN32) && !defined(MSDOS) #if defined(_WIN32) && !defined(MSDOS)
# define V_PLATFORM_WIN32s 0 # define V_PLATFORM_WIN32s 0
# define V_PLATFORM_WIN32_WINDOWS 1 # define V_PLATFORM_WIN32_WINDOWS 1
@ -78,7 +78,7 @@ win_platform ares__getplatform(void)
} }
} }
#endif /* WIN32 && ! MSDOS */ #endif /* _WIN32 && ! MSDOS */
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)

@ -29,7 +29,7 @@
#include "ares_setup.h" #include "ares_setup.h"
#if defined(WIN32) && !defined(MSDOS) #if defined(_WIN32) && !defined(MSDOS)
typedef enum { typedef enum {
WIN_UNKNOWN, WIN_UNKNOWN,

@ -27,14 +27,6 @@
#ifndef __ARES_PRIVATE_H #ifndef __ARES_PRIVATE_H
#define __ARES_PRIVATE_H #define __ARES_PRIVATE_H
/*
* Define WIN32 when build target is Win32 API
*/
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
# define WIN32
#endif
#ifdef HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H
# include <netinet/in.h> # include <netinet/in.h>
#endif #endif
@ -56,7 +48,7 @@
*/ */
#define CARES_INADDR_CAST(type, var) ((type)((void *)var)) #define CARES_INADDR_CAST(type, var) ((type)((void *)var))
#if defined(WIN32) && !defined(WATT32) #if defined(USE_WINSOCK)
# define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP" # define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
# define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters" # define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"

@ -26,14 +26,6 @@
#ifndef HEADER_CARES_SETUP_H #ifndef HEADER_CARES_SETUP_H
#define HEADER_CARES_SETUP_H #define HEADER_CARES_SETUP_H
/*
* Define WIN32 when build target is Win32 API
*/
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
# define WIN32
#endif
/* /*
* Include configuration script results or hand-crafted * Include configuration script results or hand-crafted
* configuration file for platforms which lack config tool. * configuration file for platforms which lack config tool.
@ -43,7 +35,7 @@
# include "ares_config.h" # include "ares_config.h"
#else #else
# ifdef WIN32 # ifdef _WIN32
# include "config-win32.h" # include "config-win32.h"
# endif # endif
@ -163,7 +155,7 @@
# define HAVE_UNISTD_H 1 # define HAVE_UNISTD_H 1
# endif # endif
# if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS) # if !defined(HAVE_SYS_UIO_H) && !defined(_WIN32) && !defined(MSDOS)
# define HAVE_SYS_UIO_H # define HAVE_SYS_UIO_H
# endif # endif

@ -71,12 +71,7 @@
#include "ares_platform.h" #include "ares_platform.h"
#include "ares_private.h" #include "ares_private.h"
#ifdef WATT32 #if defined(USE_WINSOCK)
# undef WIN32 /* Redefined in MingW/MSVC headers */
#endif
#ifdef WIN32
/* /*
* get_REG_SZ() * get_REG_SZ()
* *
@ -1074,7 +1069,7 @@ ares_status_t ares__init_by_sysconfig(ares_channel_t *channel)
memset(&sysconfig, 0, sizeof(sysconfig)); memset(&sysconfig, 0, sizeof(sysconfig));
#ifdef _WIN32 #if defined(USE_WINSOCK)
status = ares__init_sysconfig_windows(&sysconfig); status = ares__init_sysconfig_windows(&sysconfig);
#elif defined(__MVS__) #elif defined(__MVS__)
status = ares__init_sysconfig_mvs(&sysconfig); status = ares__init_sysconfig_mvs(&sysconfig);

@ -88,7 +88,7 @@
#define HAVE_IPHLPAPI_H 1 #define HAVE_IPHLPAPI_H 1
/* Define if you have <netioapi.h> header file */ /* Define if you have <netioapi.h> header file */
#ifndef __WATCOMC__ #if !defined(__WATCOMC__) && !defined(WATT32)
# define HAVE_NETIOAPI_H 1 # define HAVE_NETIOAPI_H 1
#endif #endif
@ -207,7 +207,12 @@
/* Specifics for the Watt-32 tcp/ip stack. */ /* Specifics for the Watt-32 tcp/ip stack. */
#ifdef WATT32 #ifdef WATT32
# define SOCKET int # undef RECV_TYPE_ARG1
# define RECV_TYPE_ARG1 int
# undef SEND_TYPE_ARG1
# define SEND_TYPE_ARG1 int
# undef RECVFROM_TYPE_ARG1
# define RECVFROM_TYPE_ARG1 int
# define NS_INADDRSZ 4 # define NS_INADDRSZ 4
# define HAVE_ARPA_NAMESER_H 1 # define HAVE_ARPA_NAMESER_H 1
# define HAVE_ARPA_INET_H 1 # define HAVE_ARPA_INET_H 1
@ -219,9 +224,12 @@
# define HAVE_PF_INET6 1 # define HAVE_PF_INET6 1
# define HAVE_STRUCT_IN6_ADDR 1 # define HAVE_STRUCT_IN6_ADDR 1
# define HAVE_STRUCT_SOCKADDR_IN6 1 # define HAVE_STRUCT_SOCKADDR_IN6 1
# define HAVE_WRITEV 1
# undef HAVE_WINSOCK_H # undef HAVE_WINSOCK_H
# undef HAVE_WINSOCK2_H # undef HAVE_WINSOCK2_H
# undef HAVE_WS2TCPIP_H # undef HAVE_WS2TCPIP_H
# undef HAVE_IPHLPAPI_H
# undef HAVE_NETIOAPI_H
#endif #endif
/* Threading support enabled */ /* Threading support enabled */
@ -342,7 +350,8 @@
# define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1 # define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1
#endif #endif
#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600) && !defined(__WATCOMC__) #if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600) && \
!defined(__WATCOMC__) && !defined(WATT32)
/* Define if you have if_nametoindex() */ /* Define if you have if_nametoindex() */
# define HAVE_IF_NAMETOINDEX 1 # define HAVE_IF_NAMETOINDEX 1
/* Define if you have if_indextoname() */ /* Define if you have if_indextoname() */

@ -75,11 +75,6 @@
# include <time.h> # include <time.h>
#endif #endif
#ifdef WIN32
# include <io.h>
# include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif

@ -11,7 +11,7 @@
/* only do the following on windows /* only do the following on windows
*/ */
#if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS) #if defined(_WIN32) && !defined(MSDOS)
# ifdef __WATCOMC__ # ifdef __WATCOMC__
/* /*

@ -62,11 +62,6 @@
#include "ares_getopt.h" #include "ares_getopt.h"
#ifdef WATT32
# undef WIN32 /* Redefined in MingW headers */
#endif
typedef struct { typedef struct {
ares_bool_t is_help; ares_bool_t is_help;
struct ares_options options; struct ares_options options;

@ -27,7 +27,7 @@
#include "ares_setup.h" #include "ares_setup.h"
#if !defined(WIN32) || defined(WATT32) #if !defined(_WIN32) || defined(WATT32)
# include <netinet/in.h> # include <netinet/in.h>
# include <arpa/inet.h> # include <arpa/inet.h>
# include <netdb.h> # include <netdb.h>

Loading…
Cancel
Save