1 #ifndef HEADER_CARES_CONFIG_WIN32_H 2 #define HEADER_CARES_CONFIG_WIN32_H 3 4 /* Copyright (C) 2004 - 2011 by Daniel Stenberg et al 5 * 6 * Permission to use, copy, modify, and distribute this software and its 7 * documentation for any purpose and without fee is hereby granted, provided 8 * that the above copyright notice appear in all copies and that both that 9 * copyright notice and this permission notice appear in supporting 10 * documentation, and that the name of M.I.T. not be used in advertising or 11 * publicity pertaining to distribution of the software without specific, 12 * written prior permission. M.I.T. makes no representations about the 13 * suitability of this software for any purpose. It is provided "as is" 14 * without express or implied warranty. 15 */ 16 17 /* ================================================================ */ 18 /* c-ares/config-win32.h - Hand crafted config file for Windows */ 19 /* ================================================================ */ 20 21 /* ---------------------------------------------------------------- */ 22 /* HEADER FILES */ 23 /* ---------------------------------------------------------------- */ 24 25 /* Define if you have the <assert.h> header file. */ 26 #define HAVE_ASSERT_H 1 27 28 /* Define if you have the <errno.h> header file. */ 29 #define HAVE_ERRNO_H 1 30 31 /* Define if you have the <getopt.h> header file. */ 32 #if defined(__MINGW32__) || defined(__POCC__) 33 #define HAVE_GETOPT_H 1 34 #endif 35 36 /* Define if you have the <limits.h> header file. */ 37 #define HAVE_LIMITS_H 1 38 39 /* Define if you have the <process.h> header file. */ 40 #ifndef __SALFORDC__ 41 #define HAVE_PROCESS_H 1 42 #endif 43 44 /* Define if you have the <signal.h> header file. */ 45 #define HAVE_SIGNAL_H 1 46 47 /* Define if you have the <sys/time.h> header file */ 48 /* #define HAVE_SYS_TIME_H 1 */ 49 50 /* Define if you have the <time.h> header file. */ 51 #define HAVE_TIME_H 1 52 53 /* Define if you have the <unistd.h> header file. */ 54 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \ 55 defined(__POCC__) 56 #define HAVE_UNISTD_H 1 57 #endif 58 59 /* Define if you have the <windows.h> header file. */ 60 #define HAVE_WINDOWS_H 1 61 62 /* Define if you have the <winsock.h> header file. */ 63 #define HAVE_WINSOCK_H 1 64 65 /* Define if you have the <winsock2.h> header file. */ 66 #ifndef __SALFORDC__ 67 #define HAVE_WINSOCK2_H 1 68 #endif 69 70 /* Define if you have the <ws2tcpip.h> header file. */ 71 #ifndef __SALFORDC__ 72 #define HAVE_WS2TCPIP_H 1 73 #endif 74 75 /* ---------------------------------------------------------------- */ 76 /* OTHER HEADER INFO */ 77 /* ---------------------------------------------------------------- */ 78 79 /* Define if sig_atomic_t is an available typedef. */ 80 #define HAVE_SIG_ATOMIC_T 1 81 82 /* Define if you have the ANSI C header files. */ 83 #define STDC_HEADERS 1 84 85 /* Define if you can safely include both <sys/time.h> and <time.h>. */ 86 /* #define TIME_WITH_SYS_TIME 1 */ 87 88 /* ---------------------------------------------------------------- */ 89 /* FUNCTIONS */ 90 /* ---------------------------------------------------------------- */ 91 92 /* Define if you have the closesocket function. */ 93 #define HAVE_CLOSESOCKET 1 94 95 /* Define if you have the getenv function. */ 96 #define HAVE_GETENV 1 97 98 /* Define if you have the gethostname function. */ 99 #define HAVE_GETHOSTNAME 1 100 101 /* Define if you have the ioctlsocket function. */ 102 #define HAVE_IOCTLSOCKET 1 103 104 /* Define if you have a working ioctlsocket FIONBIO function. */ 105 #define HAVE_IOCTLSOCKET_FIONBIO 1 106 107 /* Define if you have the strcasecmp function. */ 108 /* #define HAVE_STRCASECMP 1 */ 109 110 /* Define if you have the strdup function. */ 111 #define HAVE_STRDUP 1 112 113 /* Define if you have the stricmp function. */ 114 #define HAVE_STRICMP 1 115 116 /* Define if you have the strncasecmp function. */ 117 /* #define HAVE_STRNCASECMP 1 */ 118 119 /* Define if you have the strnicmp function. */ 120 #define HAVE_STRNICMP 1 121 122 /* Define if you have the recv function. */ 123 #define HAVE_RECV 1 124 125 /* Define to the type of arg 1 for recv. */ 126 #define RECV_TYPE_ARG1 SOCKET 127 128 /* Define to the type of arg 2 for recv. */ 129 #define RECV_TYPE_ARG2 char * 130 131 /* Define to the type of arg 3 for recv. */ 132 #define RECV_TYPE_ARG3 int 133 134 /* Define to the type of arg 4 for recv. */ 135 #define RECV_TYPE_ARG4 int 136 137 /* Define to the function return type for recv. */ 138 #define RECV_TYPE_RETV int 139 140 /* Define if you have the recvfrom function. */ 141 #define HAVE_RECVFROM 1 142 143 /* Define to the type of arg 1 for recvfrom. */ 144 #define RECVFROM_TYPE_ARG1 SOCKET 145 146 /* Define to the type pointed by arg 2 for recvfrom. */ 147 #define RECVFROM_TYPE_ARG2 char 148 149 /* Define to the type of arg 3 for recvfrom. */ 150 #define RECVFROM_TYPE_ARG3 int 151 152 /* Define to the type of arg 4 for recvfrom. */ 153 #define RECVFROM_TYPE_ARG4 int 154 155 /* Define to the type pointed by arg 5 for recvfrom. */ 156 #define RECVFROM_TYPE_ARG5 struct sockaddr 157 158 /* Define to the type pointed by arg 6 for recvfrom. */ 159 #define RECVFROM_TYPE_ARG6 int 160 161 /* Define to the function return type for recvfrom. */ 162 #define RECVFROM_TYPE_RETV int 163 164 /* Define if you have the send function. */ 165 #define HAVE_SEND 1 166 167 /* Define to the type of arg 1 for send. */ 168 #define SEND_TYPE_ARG1 SOCKET 169 170 /* Define to the type qualifier of arg 2 for send. */ 171 #define SEND_QUAL_ARG2 const 172 173 /* Define to the type of arg 2 for send. */ 174 #define SEND_TYPE_ARG2 char * 175 176 /* Define to the type of arg 3 for send. */ 177 #define SEND_TYPE_ARG3 int 178 179 /* Define to the type of arg 4 for send. */ 180 #define SEND_TYPE_ARG4 int 181 182 /* Define to the function return type for send. */ 183 #define SEND_TYPE_RETV int 184 185 /* Specifics for the Watt-32 tcp/ip stack. */ 186 #ifdef WATT32 187 #define SOCKET int 188 #define NS_INADDRSZ 4 189 #define HAVE_ARPA_NAMESER_H 1 190 #define HAVE_ARPA_INET_H 1 191 #define HAVE_NETDB_H 1 192 #define HAVE_NETINET_IN_H 1 193 #define HAVE_SYS_SOCKET_H 1 194 #define HAVE_NETINET_TCP_H 1 195 #define HAVE_AF_INET6 1 196 #define HAVE_PF_INET6 1 197 #define HAVE_STRUCT_IN6_ADDR 1 198 #define HAVE_STRUCT_SOCKADDR_IN6 1 199 #undef HAVE_WINSOCK_H 200 #undef HAVE_WINSOCK2_H 201 #undef HAVE_WS2TCPIP_H 202 #endif 203 204 /* ---------------------------------------------------------------- */ 205 /* TYPEDEF REPLACEMENTS */ 206 /* ---------------------------------------------------------------- */ 207 208 /* Define if in_addr_t is not an available 'typedefed' type. */ 209 #define in_addr_t unsigned long 210 211 /* Define to the return type of signal handlers (int or void). */ 212 #define RETSIGTYPE void 213 214 /* Define if ssize_t is not an available 'typedefed' type. */ 215 #ifndef _SSIZE_T_DEFINED 216 # if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \ 217 defined(__POCC__) || \ 218 defined(__MINGW32__) 219 # elif defined(_WIN64) 220 # define _SSIZE_T_DEFINED 221 # define ssize_t __int64 222 # else 223 # define _SSIZE_T_DEFINED 224 # define ssize_t int 225 # endif 226 #endif 227 228 /* ---------------------------------------------------------------- */ 229 /* TYPE SIZES */ 230 /* ---------------------------------------------------------------- */ 231 232 /* Define to the size of `int', as computed by sizeof. */ 233 #define SIZEOF_INT 4 234 235 /* Define to the size of `short', as computed by sizeof. */ 236 #define SIZEOF_SHORT 2 237 238 /* Define to the size of `size_t', as computed by sizeof. */ 239 #if defined(_WIN64) 240 # define SIZEOF_SIZE_T 8 241 #else 242 # define SIZEOF_SIZE_T 4 243 #endif 244 245 /* ---------------------------------------------------------------- */ 246 /* STRUCT RELATED */ 247 /* ---------------------------------------------------------------- */ 248 249 /* Define if you have struct addrinfo. */ 250 #define HAVE_STRUCT_ADDRINFO 1 251 252 /* Define if you have struct sockaddr_storage. */ 253 #if !defined(__SALFORDC__) && !defined(__BORLANDC__) 254 #define HAVE_STRUCT_SOCKADDR_STORAGE 1 255 #endif 256 257 /* Define if you have struct timeval. */ 258 #define HAVE_STRUCT_TIMEVAL 1 259 260 /* ---------------------------------------------------------------- */ 261 /* COMPILER SPECIFIC */ 262 /* ---------------------------------------------------------------- */ 263 264 /* Define to avoid VS2005 complaining about portable C functions. */ 265 #if defined(_MSC_VER) && (_MSC_VER >= 1400) 266 # define _CRT_SECURE_NO_DEPRECATE 1 267 # define _CRT_NONSTDC_NO_DEPRECATE 1 268 #endif 269 270 /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows 271 2000 as a supported build target. VS2008 default installations provide 272 an embedded Windows SDK v6.0A along with the claim that Windows 2000 is 273 a valid build target for VS2008. Popular belief is that binaries built 274 with VS2008 using Windows SDK versions 6.X and Windows 2000 as a build 275 target are functional. */ 276 #if defined(_MSC_VER) && (_MSC_VER >= 1500) 277 # define VS2008_MIN_TARGET 0x0500 278 #endif 279 280 /* When no build target is specified VS2008 default build target is Windows 281 Vista, which leaves out even Winsows XP. If no build target has been given 282 for VS2008 we will target the minimum Officially supported build target, 283 which happens to be Windows XP. */ 284 #if defined(_MSC_VER) && (_MSC_VER >= 1500) 285 # define VS2008_DEF_TARGET 0x0501 286 #endif 287 288 /* VS2008 default target settings and minimum build target check. */ 289 #if defined(_MSC_VER) && (_MSC_VER >= 1500) 290 # ifndef _WIN32_WINNT 291 # define _WIN32_WINNT VS2008_DEF_TARGET 292 # endif 293 # ifndef WINVER 294 # define WINVER VS2008_DEF_TARGET 295 # endif 296 # if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET) 297 # error VS2008 does not support Windows build targets prior to Windows 2000 298 # endif 299 #endif 300 301 /* When no build target is specified Pelles C 5.00 and later default build 302 target is Windows Vista. We override default target to be Windows 2000. */ 303 #if defined(__POCC__) && (__POCC__ >= 500) 304 # ifndef _WIN32_WINNT 305 # define _WIN32_WINNT 0x0500 306 # endif 307 # ifndef WINVER 308 # define WINVER 0x0500 309 # endif 310 #endif 311 312 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is 313 quite convoluted, compiler dependent and even build target dependent. */ 314 #if defined(HAVE_WS2TCPIP_H) 315 # if defined(__POCC__) 316 # define HAVE_FREEADDRINFO 1 317 # define HAVE_GETADDRINFO 1 318 # define HAVE_GETNAMEINFO 1 319 # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) 320 # define HAVE_FREEADDRINFO 1 321 # define HAVE_GETADDRINFO 1 322 # define HAVE_GETNAMEINFO 1 323 # elif defined(_MSC_VER) && (_MSC_VER >= 1200) 324 # define HAVE_FREEADDRINFO 1 325 # define HAVE_GETADDRINFO 1 326 # define HAVE_GETNAMEINFO 1 327 # endif 328 #endif 329 330 #if defined(__POCC__) 331 # ifndef _MSC_VER 332 # error Microsoft extensions /Ze compiler option is required 333 # endif 334 # ifndef __POCC__OLDNAMES 335 # error Compatibility names /Go compiler option is required 336 # endif 337 #endif 338 339 /* ---------------------------------------------------------------- */ 340 /* IPV6 COMPATIBILITY */ 341 /* ---------------------------------------------------------------- */ 342 343 /* Define if you have address family AF_INET6. */ 344 #ifdef HAVE_WINSOCK2_H 345 #define HAVE_AF_INET6 1 346 #endif 347 348 /* Define if you have protocol family PF_INET6. */ 349 #ifdef HAVE_WINSOCK2_H 350 #define HAVE_PF_INET6 1 351 #endif 352 353 /* Define if you have struct in6_addr. */ 354 #ifdef HAVE_WS2TCPIP_H 355 #define HAVE_STRUCT_IN6_ADDR 1 356 #endif 357 358 /* Define if you have struct sockaddr_in6. */ 359 #ifdef HAVE_WS2TCPIP_H 360 #define HAVE_STRUCT_SOCKADDR_IN6 1 361 #endif 362 363 /* Define if you have sockaddr_in6 with scopeid. */ 364 #ifdef HAVE_WS2TCPIP_H 365 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 366 #endif 367 368 369 #endif /* HEADER_CARES_CONFIG_WIN32_H */ 370