1 /* MIT License 2 * 3 * Copyright (c) 2004 Daniel Stenberg 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a copy 6 * of this software and associated documentation files (the "Software"), to deal 7 * in the Software without restriction, including without limitation the rights 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 * copies of the Software, and to permit persons to whom the Software is 10 * furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice (including the next 13 * paragraph) shall be included in all copies or substantial portions of the 14 * Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 * SOFTWARE. 23 * 24 * SPDX-License-Identifier: MIT 25 */ 26 #ifndef HEADER_CARES_CONFIG_WIN32_H 27 #define HEADER_CARES_CONFIG_WIN32_H 28 29 /* ================================================================ */ 30 /* c-ares/config-win32.h - Hand crafted config file for Windows */ 31 /* ================================================================ */ 32 33 /* ---------------------------------------------------------------- */ 34 /* HEADER FILES */ 35 /* ---------------------------------------------------------------- */ 36 37 /* Define if you have the <assert.h> header file. */ 38 #define HAVE_ASSERT_H 1 39 40 /* Define if you have the <errno.h> header file. */ 41 #define HAVE_ERRNO_H 1 42 43 /* Define if you have the <getopt.h> header file. */ 44 #if defined(__MINGW32__) || defined(__POCC__) 45 # define HAVE_GETOPT_H 1 46 #endif 47 48 /* Define if you have the <limits.h> header file. */ 49 #define HAVE_LIMITS_H 1 50 51 /* Define if you have the <process.h> header file. */ 52 #ifndef __SALFORDC__ 53 # define HAVE_PROCESS_H 1 54 #endif 55 56 /* Define if you have the <signal.h> header file. */ 57 #define HAVE_SIGNAL_H 1 58 59 /* Define if you have the <sys/time.h> header file */ 60 /* #define HAVE_SYS_TIME_H 1 */ 61 62 /* Define if you have the <time.h> header file. */ 63 #define HAVE_TIME_H 1 64 65 /* Define if you have the <unistd.h> header file. */ 66 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \ 67 defined(__POCC__) 68 # define HAVE_UNISTD_H 1 69 #endif 70 71 /* Define if you have the <windows.h> header file. */ 72 #define HAVE_WINDOWS_H 1 73 74 /* Define if you have the <winsock.h> header file. */ 75 #define HAVE_WINSOCK_H 1 76 77 /* Define if you have the <winsock2.h> header file. */ 78 #ifndef __SALFORDC__ 79 # define HAVE_WINSOCK2_H 1 80 #endif 81 82 /* Define if you have the <ws2tcpip.h> header file. */ 83 #ifndef __SALFORDC__ 84 # define HAVE_WS2TCPIP_H 1 85 #endif 86 87 /* Define if you have <iphlpapi.h> header file */ 88 #define HAVE_IPHLPAPI_H 1 89 90 /* Define if you have <netioapi.h> header file */ 91 #if !defined(__WATCOMC__) && !defined(WATT32) 92 # define HAVE_NETIOAPI_H 1 93 #endif 94 95 #define HAVE_SYS_TYPES_H 1 96 #define HAVE_SYS_STAT_H 1 97 98 /* If we are building with OpenWatcom, we need to specify that we have 99 * <stdint.h>. */ 100 #if defined(__WATCOMC__) 101 # define HAVE_STDINT_H 102 #endif 103 104 /* ---------------------------------------------------------------- */ 105 /* OTHER HEADER INFO */ 106 /* ---------------------------------------------------------------- */ 107 108 /* Define if you have the ANSI C header files. */ 109 #define STDC_HEADERS 1 110 111 /* ---------------------------------------------------------------- */ 112 /* FUNCTIONS */ 113 /* ---------------------------------------------------------------- */ 114 115 /* Define if you have the closesocket function. */ 116 #define HAVE_CLOSESOCKET 1 117 118 /* Define if you have the getenv function. */ 119 #define HAVE_GETENV 1 120 121 /* Define if you have the gethostname function. */ 122 #define HAVE_GETHOSTNAME 1 123 124 /* Define if you have the ioctlsocket function. */ 125 #define HAVE_IOCTLSOCKET 1 126 127 /* Define if you have a working ioctlsocket FIONBIO function. */ 128 #define HAVE_IOCTLSOCKET_FIONBIO 1 129 130 /* Define if you have the strcasecmp function. */ 131 /* #define HAVE_STRCASECMP 1 */ 132 133 /* Define if you have the strdup function. */ 134 #define HAVE_STRDUP 1 135 136 /* Define if you have the stricmp function. */ 137 #define HAVE_STRICMP 1 138 139 /* Define if you have the strncasecmp function. */ 140 /* #define HAVE_STRNCASECMP 1 */ 141 142 /* Define if you have the strnicmp function. */ 143 #define HAVE_STRNICMP 1 144 145 /* Define if you have the recv function. */ 146 #define HAVE_RECV 1 147 148 /* Define to the type of arg 1 for recv. */ 149 #define RECV_TYPE_ARG1 SOCKET 150 151 /* Define to the type of arg 2 for recv. */ 152 #define RECV_TYPE_ARG2 char * 153 154 /* Define to the type of arg 3 for recv. */ 155 #define RECV_TYPE_ARG3 int 156 157 /* Define to the type of arg 4 for recv. */ 158 #define RECV_TYPE_ARG4 int 159 160 /* Define to the function return type for recv. */ 161 #define RECV_TYPE_RETV int 162 163 /* Define if you have the recvfrom function. */ 164 #define HAVE_RECVFROM 1 165 166 /* Define to the type of arg 1 for recvfrom. */ 167 #define RECVFROM_TYPE_ARG1 SOCKET 168 169 /* Define to the type pointed by arg 2 for recvfrom. */ 170 #define RECVFROM_TYPE_ARG2 char 171 172 /* Define to the type of arg 3 for recvfrom. */ 173 #define RECVFROM_TYPE_ARG3 int 174 175 /* Define to the type of arg 4 for recvfrom. */ 176 #define RECVFROM_TYPE_ARG4 int 177 178 /* Define to the type pointed by arg 5 for recvfrom. */ 179 #define RECVFROM_TYPE_ARG5 struct sockaddr 180 181 /* Define to the type pointed by arg 6 for recvfrom. */ 182 #define RECVFROM_TYPE_ARG6 int 183 184 /* Define to the function return type for recvfrom. */ 185 #define RECVFROM_TYPE_RETV int 186 187 /* Define if you have the send function. */ 188 #define HAVE_SEND 1 189 190 /* Define if you have the sendto function. */ 191 #define HAVE_SENDTO 1 192 193 /* Define to the type of arg 1 for send. */ 194 #define SEND_TYPE_ARG1 SOCKET 195 196 /* Define to the type of arg 2 for send. */ 197 #define SEND_TYPE_ARG2 const char * 198 199 /* Define to the type of arg 3 for send. */ 200 #define SEND_TYPE_ARG3 int 201 202 /* Define to the type of arg 4 for send. */ 203 #define SEND_TYPE_ARG4 int 204 205 /* Define to the function return type for send. */ 206 #define SEND_TYPE_RETV int 207 208 /* Specifics for the Watt-32 tcp/ip stack. */ 209 #ifdef WATT32 210 # undef RECV_TYPE_ARG1 211 # define RECV_TYPE_ARG1 int 212 # undef SEND_TYPE_ARG1 213 # define SEND_TYPE_ARG1 int 214 # undef RECVFROM_TYPE_ARG1 215 # define RECVFROM_TYPE_ARG1 int 216 # define NS_INADDRSZ 4 217 # define HAVE_ARPA_NAMESER_H 1 218 # define HAVE_ARPA_INET_H 1 219 # define HAVE_NETDB_H 1 220 # define HAVE_NETINET_IN_H 1 221 # define HAVE_SYS_SOCKET_H 1 222 # define HAVE_SYS_IOCTL_H 1 223 # define HAVE_NETINET_TCP_H 1 224 # define HAVE_AF_INET6 1 225 # define HAVE_PF_INET6 1 226 # define HAVE_STRUCT_IN6_ADDR 1 227 # define HAVE_STRUCT_SOCKADDR_IN6 1 228 # define HAVE_WRITEV 1 229 # define HAVE_IF_NAMETOINDEX 1 230 # define HAVE_IF_INDEXTONAME 1 231 # define HAVE_GETSERVBYPORT_R 1 232 # define GETSERVBYPORT_R_ARGS 6 233 # undef HAVE_WINSOCK_H 234 # undef HAVE_WINSOCK2_H 235 # undef HAVE_WS2TCPIP_H 236 # undef HAVE_IPHLPAPI_H 237 # undef HAVE_NETIOAPI_H 238 #endif 239 240 /* Threading support enabled for Vista+ */ 241 #if !defined(_WIN32_WINNT) || _WIN32_WINNT >= 0x0600 242 # define CARES_THREADS 1 243 #endif 244 245 /* ---------------------------------------------------------------- */ 246 /* TYPEDEF REPLACEMENTS */ 247 /* ---------------------------------------------------------------- */ 248 249 /* ---------------------------------------------------------------- */ 250 /* TYPE SIZES */ 251 /* ---------------------------------------------------------------- */ 252 253 /* ---------------------------------------------------------------- */ 254 /* STRUCT RELATED */ 255 /* ---------------------------------------------------------------- */ 256 257 /* Define if you have struct addrinfo. */ 258 #define HAVE_STRUCT_ADDRINFO 1 259 260 /* Define if you have struct sockaddr_storage. */ 261 #if !defined(__SALFORDC__) && !defined(__BORLANDC__) 262 # define HAVE_STRUCT_SOCKADDR_STORAGE 1 263 #endif 264 265 /* Define if you have struct timeval. */ 266 #define HAVE_STRUCT_TIMEVAL 1 267 268 /* ---------------------------------------------------------------- */ 269 /* COMPILER SPECIFIC */ 270 /* ---------------------------------------------------------------- */ 271 272 /* Define to avoid VS2005 complaining about portable C functions. */ 273 #if defined(_MSC_VER) && (_MSC_VER >= 1400) 274 # define _CRT_SECURE_NO_DEPRECATE 1 275 # define _CRT_NONSTDC_NO_DEPRECATE 1 276 #endif 277 278 /* Set the Target to Win8 */ 279 #if defined(_MSC_VER) && (_MSC_VER >= 1500) 280 # define MSVC_MIN_TARGET 0x0602 281 #endif 282 283 /* MSVC default target settings */ 284 #if defined(_MSC_VER) && (_MSC_VER >= 1500) 285 # ifndef _WIN32_WINNT 286 # define _WIN32_WINNT MSVC_MIN_TARGET 287 # endif 288 # ifndef WINVER 289 # define WINVER MSVC_MIN_TARGET 290 # endif 291 #endif 292 293 /* When no build target is specified Pelles C 5.00 and later default build 294 target is Windows Vista. */ 295 #if defined(__POCC__) && (__POCC__ >= 500) 296 # ifndef _WIN32_WINNT 297 # define _WIN32_WINNT 0x0602 298 # endif 299 # ifndef WINVER 300 # define WINVER 0x0602 301 # endif 302 #endif 303 304 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is 305 quite convoluted, compiler dependent and even build target dependent. */ 306 #if defined(HAVE_WS2TCPIP_H) 307 # if defined(__POCC__) 308 # define HAVE_FREEADDRINFO 1 309 # define HAVE_GETADDRINFO 1 310 # define HAVE_GETNAMEINFO 1 311 # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) 312 # define HAVE_FREEADDRINFO 1 313 # define HAVE_GETADDRINFO 1 314 # define HAVE_GETNAMEINFO 1 315 # elif defined(_MSC_VER) && (_MSC_VER >= 1200) 316 # define HAVE_FREEADDRINFO 1 317 # define HAVE_GETADDRINFO 1 318 # define HAVE_GETNAMEINFO 1 319 # endif 320 #endif 321 322 #if defined(__POCC__) 323 # ifndef _MSC_VER 324 # error Microsoft extensions /Ze compiler option is required 325 # endif 326 # ifndef __POCC__OLDNAMES 327 # error Compatibility names /Go compiler option is required 328 # endif 329 #endif 330 331 /* ---------------------------------------------------------------- */ 332 /* IPV6 COMPATIBILITY */ 333 /* ---------------------------------------------------------------- */ 334 335 /* Define if you have address family AF_INET6. */ 336 #ifdef HAVE_WINSOCK2_H 337 # define HAVE_AF_INET6 1 338 #endif 339 340 /* Define if you have protocol family PF_INET6. */ 341 #ifdef HAVE_WINSOCK2_H 342 # define HAVE_PF_INET6 1 343 #endif 344 345 /* Define if you have struct in6_addr. */ 346 #ifdef HAVE_WS2TCPIP_H 347 # define HAVE_STRUCT_IN6_ADDR 1 348 #endif 349 350 /* Define if you have struct sockaddr_in6. */ 351 #ifdef HAVE_WS2TCPIP_H 352 # define HAVE_STRUCT_SOCKADDR_IN6 1 353 #endif 354 355 /* Define if you have sockaddr_in6 with scopeid. */ 356 #ifdef HAVE_WS2TCPIP_H 357 # define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1 358 #endif 359 360 /* Define to 1 if you have the `RegisterWaitForSingleObject' function. */ 361 #define HAVE_REGISTERWAITFORSINGLEOBJECT 1 362 363 #if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600) && \ 364 !defined(__WATCOMC__) && !defined(WATT32) 365 /* Define if you have if_nametoindex() */ 366 # define HAVE_IF_NAMETOINDEX 1 367 /* Define if you have if_indextoname() */ 368 # define HAVE_IF_INDEXTONAME 1 369 /* Define to 1 if you have the `ConvertInterfaceIndexToLuid' function. */ 370 # define HAVE_CONVERTINTERFACEINDEXTOLUID 1 371 /* Define to 1 if you have the `ConvertInterfaceLuidToNameA' function. */ 372 # define HAVE_CONVERTINTERFACELUIDTONAMEA 1 373 /* Define to 1 if you have the `NotifyIpInterfaceChange' function. */ 374 # define HAVE_NOTIFYIPINTERFACECHANGE 1 375 /* Define to 1 if you have the `GetBestRoute2` function */ 376 # define HAVE_GETBESTROUTE2 1 377 #endif 378 379 /* ---------------------------------------------------------------- */ 380 /* Win CE */ 381 /* ---------------------------------------------------------------- */ 382 383 /* FIXME: A proper config-win32ce.h should be created to hold these */ 384 385 /* 386 * System error codes for Windows CE 387 */ 388 389 #if defined(_WIN32_WCE) && !defined(HAVE_ERRNO_H) 390 # define ENOENT ERROR_FILE_NOT_FOUND 391 # define ESRCH ERROR_PATH_NOT_FOUND 392 # define ENOMEM ERROR_NOT_ENOUGH_MEMORY 393 # define ENOSPC ERROR_INVALID_PARAMETER 394 #endif 395 396 #endif /* HEADER_CARES_CONFIG_WIN32_H */ 397