1 #ifndef __ARES_CONFIG_WIN32_H
2 #define __ARES_CONFIG_WIN32_H
5 /* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation for any purpose and without fee is hereby granted, provided
9 * that the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
11 * documentation, and that the name of M.I.T. not be used in advertising or
12 * publicity pertaining to distribution of the software without specific,
13 * written prior permission. M.I.T. makes no representations about the
14 * suitability of this software for any purpose. It is provided "as is"
15 * without express or implied warranty.
18 /* ================================================================ */
19 /* ares/config-win32.h - Hand crafted config file for Windows */
20 /* ================================================================ */
22 /* ---------------------------------------------------------------- */
24 /* ---------------------------------------------------------------- */
26 /* Define if you have the <getopt.h> header file. */
27 #if defined(__MINGW32__) || defined(__POCC__)
28 #define HAVE_GETOPT_H 1
31 /* Define if you have the <limits.h> header file. */
32 #define HAVE_LIMITS_H 1
34 /* Define if you have the <process.h> header file. */
36 #define HAVE_PROCESS_H 1
39 /* Define if you have the <signal.h> header file. */
40 #define HAVE_SIGNAL_H 1
42 /* Define if you have the <sys/time.h> header file */
43 /* #define HAVE_SYS_TIME_H 1 */
45 /* Define if you have the <time.h> header file. */
48 /* Define if you have the <unistd.h> header file. */
49 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
51 #define HAVE_UNISTD_H 1
54 /* Define if you have the <windows.h> header file. */
55 #define HAVE_WINDOWS_H 1
57 /* Define if you have the <winsock.h> header file. */
58 #define HAVE_WINSOCK_H 1
60 /* Define if you have the <winsock2.h> header file. */
62 #define HAVE_WINSOCK2_H 1
65 /* Define if you have the <ws2tcpip.h> header file. */
67 #define HAVE_WS2TCPIP_H 1
70 /* ---------------------------------------------------------------- */
71 /* OTHER HEADER INFO */
72 /* ---------------------------------------------------------------- */
74 /* Define if sig_atomic_t is an available typedef. */
75 #define HAVE_SIG_ATOMIC_T 1
77 /* Define if you have the ANSI C header files. */
78 #define STDC_HEADERS 1
80 /* Define if you can safely include both <sys/time.h> and <time.h>. */
81 /* #define TIME_WITH_SYS_TIME 1 */
83 /* ---------------------------------------------------------------- */
85 /* ---------------------------------------------------------------- */
87 /* Define if you have the closesocket function. */
88 #define HAVE_CLOSESOCKET 1
90 /* Define if you have the gethostname function. */
91 #define HAVE_GETHOSTNAME 1
93 /* Define if you have the ioctlsocket function. */
94 #define HAVE_IOCTLSOCKET 1
96 /* Define if you have a working ioctlsocket FIONBIO function. */
97 #define HAVE_IOCTLSOCKET_FIONBIO 1
99 /* Define if you have the strcasecmp function. */
100 /* #define HAVE_STRCASECMP 1 */
102 /* Define if you have the strdup function. */
103 #define HAVE_STRDUP 1
105 /* Define if you have the stricmp function. */
106 #define HAVE_STRICMP 1
108 /* Define if you have the strncasecmp function. */
109 /* #define HAVE_STRNCASECMP 1 */
111 /* Define if you have the strnicmp function. */
112 #define HAVE_STRNICMP 1
114 /* Define if you have the recv function. */
117 /* Define to the type of arg 1 for recv. */
118 #define RECV_TYPE_ARG1 SOCKET
120 /* Define to the type of arg 2 for recv. */
121 #define RECV_TYPE_ARG2 char *
123 /* Define to the type of arg 3 for recv. */
124 #define RECV_TYPE_ARG3 int
126 /* Define to the type of arg 4 for recv. */
127 #define RECV_TYPE_ARG4 int
129 /* Define to the function return type for recv. */
130 #define RECV_TYPE_RETV int
132 /* Define if you have the recvfrom function. */
133 #define HAVE_RECVFROM 1
135 /* Define to the type of arg 1 for recvfrom. */
136 #define RECVFROM_TYPE_ARG1 SOCKET
138 /* Define to the type pointed by arg 2 for recvfrom. */
139 #define RECVFROM_TYPE_ARG2 char
141 /* Define to the type of arg 3 for recvfrom. */
142 #define RECVFROM_TYPE_ARG3 int
144 /* Define to the type of arg 4 for recvfrom. */
145 #define RECVFROM_TYPE_ARG4 int
147 /* Define to the type pointed by arg 5 for recvfrom. */
148 #define RECVFROM_TYPE_ARG5 struct sockaddr
150 /* Define to the type pointed by arg 6 for recvfrom. */
151 #define RECVFROM_TYPE_ARG6 int
153 /* Define to the function return type for recvfrom. */
154 #define RECVFROM_TYPE_RETV int
156 /* Define if you have the send function. */
159 /* Define to the type of arg 1 for send. */
160 #define SEND_TYPE_ARG1 SOCKET
162 /* Define to the type qualifier of arg 2 for send. */
163 #define SEND_QUAL_ARG2 const
165 /* Define to the type of arg 2 for send. */
166 #define SEND_TYPE_ARG2 char *
168 /* Define to the type of arg 3 for send. */
169 #define SEND_TYPE_ARG3 int
171 /* Define to the type of arg 4 for send. */
172 #define SEND_TYPE_ARG4 int
174 /* Define to the function return type for send. */
175 #define SEND_TYPE_RETV int
177 /* Specifics for the Watt-32 tcp/ip stack */
180 #define NS_INADDRSZ 4
181 #define HAVE_ARPA_NAMESER_H 1
182 #define HAVE_ARPA_INET_H 1
183 #define HAVE_NETDB_H 1
184 #define HAVE_NETINET_IN_H 1
185 #define HAVE_SYS_SOCKET_H 1
186 #define HAVE_NETINET_TCP_H 1
187 #define HAVE_AF_INET6 1
188 #define HAVE_PF_INET6 1
189 #define HAVE_STRUCT_IN6_ADDR 1
190 #define HAVE_STRUCT_SOCKADDR_IN6 1
191 #undef HAVE_WINSOCK_H
192 #undef HAVE_WINSOCK2_H
193 #undef HAVE_WS2TCPIP_H
196 /* ---------------------------------------------------------------- */
197 /* TYPEDEF REPLACEMENTS */
198 /* ---------------------------------------------------------------- */
200 /* Define this if in_addr_t is not an available 'typedefed' type */
201 #define in_addr_t unsigned long
203 /* Define as the return type of signal handlers (int or void). */
204 #define RETSIGTYPE void
206 /* Define ssize_t if it is not an available 'typedefed' type */
207 #ifndef _SSIZE_T_DEFINED
208 # if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
209 defined(__POCC__) || \
211 # elif defined(_WIN64)
212 # define _SSIZE_T_DEFINED
213 # define ssize_t __int64
215 # define _SSIZE_T_DEFINED
220 /* ---------------------------------------------------------------- */
222 /* ---------------------------------------------------------------- */
224 /* The size of `int', as computed by sizeof. */
227 /* The size of `short', as computed by sizeof. */
228 #define SIZEOF_SHORT 2
230 /* ---------------------------------------------------------------- */
232 /* ---------------------------------------------------------------- */
234 /* Define this if you have struct addrinfo */
235 #define HAVE_STRUCT_ADDRINFO 1
237 /* Define this if you have struct sockaddr_storage */
239 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
242 /* Define this if you have struct timeval */
243 #define HAVE_STRUCT_TIMEVAL 1
245 /* ---------------------------------------------------------------- */
246 /* COMPILER SPECIFIC */
247 /* ---------------------------------------------------------------- */
249 /* Define to avoid VS2005 complaining about portable C functions */
250 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
251 #define _CRT_SECURE_NO_DEPRECATE 1
252 #define _CRT_NONSTDC_NO_DEPRECATE 1
255 /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
256 2000 as a supported build target. VS2008 default installations provide an
257 embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
258 valid build target for VS2008. Popular belief is that binaries built using
259 Windows SDK versions 6.X and Windows 2000 as a build target are functional */
260 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
261 # define VS2008_MINIMUM_TARGET 0x0500
264 /* When no build target is specified VS2008 default build target is Windows
265 Vista, which leaves out even Winsows XP. If no build target has been given
266 for VS2008 we will target the minimum Officially supported build target,
267 which happens to be Windows XP. */
268 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
269 # define VS2008_DEFAULT_TARGET 0x0501
272 /* VS2008 default target settings and minimum build target check */
273 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
274 # ifndef _WIN32_WINNT
275 # define _WIN32_WINNT VS2008_DEFAULT_TARGET
278 # define WINVER VS2008_DEFAULT_TARGET
280 # if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
281 # error VS2008 does not support Windows build targets prior to Windows 2000
285 /* When no build target is specified Pelles C 5.00 and later default build
286 target is Windows Vista. We override default target to be Windows 2000. */
287 #if defined(__POCC__) && (__POCC__ >= 500)
288 # ifndef _WIN32_WINNT
289 # define _WIN32_WINNT 0x0500
292 # define WINVER 0x0500
296 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
297 quite convoluted, compiler dependent and even build target dependent. */
298 #if defined(HAVE_WS2TCPIP_H)
299 # if defined(__POCC__)
300 # define HAVE_FREEADDRINFO 1
301 # define HAVE_GETADDRINFO 1
302 # define HAVE_GETNAMEINFO 1
303 # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
304 # define HAVE_FREEADDRINFO 1
305 # define HAVE_GETADDRINFO 1
306 # define HAVE_GETNAMEINFO 1
307 # elif defined(_MSC_VER) && (_MSC_VER >= 1200)
308 # define HAVE_FREEADDRINFO 1
309 # define HAVE_GETADDRINFO 1
310 # define HAVE_GETNAMEINFO 1
314 #if defined(__POCC__)
316 # error Microsoft extensions /Ze compiler option is required
318 # ifndef __POCC__OLDNAMES
319 # error Compatibility names /Go compiler option is required
323 /* ---------------------------------------------------------------- */
324 /* IPV6 COMPATIBILITY */
325 /* ---------------------------------------------------------------- */
327 /* Define this if you have address family AF_INET6 */
328 #ifdef HAVE_WINSOCK2_H
329 #define HAVE_AF_INET6 1
332 /* Define this if you have protocol family PF_INET6 */
333 #ifdef HAVE_WINSOCK2_H
334 #define HAVE_PF_INET6 1
337 /* Define this if you have struct in6_addr */
338 #ifdef HAVE_WS2TCPIP_H
339 #define HAVE_STRUCT_IN6_ADDR 1
342 /* Define this if you have struct sockaddr_in6 */
343 #ifdef HAVE_WS2TCPIP_H
344 #define HAVE_STRUCT_SOCKADDR_IN6 1
347 /* Define this if you have sockaddr_in6 with scopeid */
348 #ifdef HAVE_WS2TCPIP_H
349 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
353 #endif /* __ARES_CONFIG_WIN32_H */