1 #ifndef HEADER_CARES_CONFIG_WIN32_H
2 #define HEADER_CARES_CONFIG_WIN32_H
4 /* Copyright (C) 2004 - 2011 by Daniel Stenberg et al
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.
17 /* ================================================================ */
18 /* c-ares/config-win32.h - Hand crafted config file for Windows */
19 /* ================================================================ */
21 /* ---------------------------------------------------------------- */
23 /* ---------------------------------------------------------------- */
25 /* Define if you have the <assert.h> header file. */
26 #define HAVE_ASSERT_H 1
28 /* Define if you have the <errno.h> header file. */
29 #define HAVE_ERRNO_H 1
31 /* Define if you have the <getopt.h> header file. */
32 #if defined(__MINGW32__) || defined(__POCC__)
33 #define HAVE_GETOPT_H 1
36 /* Define if you have the <limits.h> header file. */
37 #define HAVE_LIMITS_H 1
39 /* Define if you have the <process.h> header file. */
41 #define HAVE_PROCESS_H 1
44 /* Define if you have the <signal.h> header file. */
45 #define HAVE_SIGNAL_H 1
47 /* Define if you have the <sys/time.h> header file */
48 /* #define HAVE_SYS_TIME_H 1 */
50 /* Define if you have the <time.h> header file. */
53 /* Define if you have the <unistd.h> header file. */
54 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
56 #define HAVE_UNISTD_H 1
59 /* Define if you have the <windows.h> header file. */
60 #define HAVE_WINDOWS_H 1
62 /* Define if you have the <winsock.h> header file. */
63 #define HAVE_WINSOCK_H 1
65 /* Define if you have the <winsock2.h> header file. */
67 #define HAVE_WINSOCK2_H 1
70 /* Define if you have the <ws2tcpip.h> header file. */
72 #define HAVE_WS2TCPIP_H 1
75 /* ---------------------------------------------------------------- */
76 /* OTHER HEADER INFO */
77 /* ---------------------------------------------------------------- */
79 /* Define if sig_atomic_t is an available typedef. */
80 #define HAVE_SIG_ATOMIC_T 1
82 /* Define if you have the ANSI C header files. */
83 #define STDC_HEADERS 1
85 /* Define if you can safely include both <sys/time.h> and <time.h>. */
86 /* #define TIME_WITH_SYS_TIME 1 */
88 /* ---------------------------------------------------------------- */
90 /* ---------------------------------------------------------------- */
92 /* Define if you have the closesocket function. */
93 #define HAVE_CLOSESOCKET 1
95 /* Define if you have the getenv function. */
98 /* Define if you have the gethostname function. */
99 #define HAVE_GETHOSTNAME 1
101 /* Define if you have the ioctlsocket function. */
102 #define HAVE_IOCTLSOCKET 1
104 /* Define if you have a working ioctlsocket FIONBIO function. */
105 #define HAVE_IOCTLSOCKET_FIONBIO 1
107 /* Define if you have the strcasecmp function. */
108 /* #define HAVE_STRCASECMP 1 */
110 /* Define if you have the strdup function. */
111 #define HAVE_STRDUP 1
113 /* Define if you have the stricmp function. */
114 #define HAVE_STRICMP 1
116 /* Define if you have the strncasecmp function. */
117 /* #define HAVE_STRNCASECMP 1 */
119 /* Define if you have the strnicmp function. */
120 #define HAVE_STRNICMP 1
122 /* Define if you have the recv function. */
125 /* Define to the type of arg 1 for recv. */
126 #define RECV_TYPE_ARG1 SOCKET
128 /* Define to the type of arg 2 for recv. */
129 #define RECV_TYPE_ARG2 char *
131 /* Define to the type of arg 3 for recv. */
132 #define RECV_TYPE_ARG3 int
134 /* Define to the type of arg 4 for recv. */
135 #define RECV_TYPE_ARG4 int
137 /* Define to the function return type for recv. */
138 #define RECV_TYPE_RETV int
140 /* Define if you have the recvfrom function. */
141 #define HAVE_RECVFROM 1
143 /* Define to the type of arg 1 for recvfrom. */
144 #define RECVFROM_TYPE_ARG1 SOCKET
146 /* Define to the type pointed by arg 2 for recvfrom. */
147 #define RECVFROM_TYPE_ARG2 char
149 /* Define to the type of arg 3 for recvfrom. */
150 #define RECVFROM_TYPE_ARG3 int
152 /* Define to the type of arg 4 for recvfrom. */
153 #define RECVFROM_TYPE_ARG4 int
155 /* Define to the type pointed by arg 5 for recvfrom. */
156 #define RECVFROM_TYPE_ARG5 struct sockaddr
158 /* Define to the type pointed by arg 6 for recvfrom. */
159 #define RECVFROM_TYPE_ARG6 int
161 /* Define to the function return type for recvfrom. */
162 #define RECVFROM_TYPE_RETV int
164 /* Define if you have the send function. */
167 /* Define to the type of arg 1 for send. */
168 #define SEND_TYPE_ARG1 SOCKET
170 /* Define to the type qualifier of arg 2 for send. */
171 #define SEND_QUAL_ARG2 const
173 /* Define to the type of arg 2 for send. */
174 #define SEND_TYPE_ARG2 char *
176 /* Define to the type of arg 3 for send. */
177 #define SEND_TYPE_ARG3 int
179 /* Define to the type of arg 4 for send. */
180 #define SEND_TYPE_ARG4 int
182 /* Define to the function return type for send. */
183 #define SEND_TYPE_RETV int
185 /* Specifics for the Watt-32 tcp/ip stack. */
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
204 /* ---------------------------------------------------------------- */
205 /* TYPEDEF REPLACEMENTS */
206 /* ---------------------------------------------------------------- */
208 /* Define if in_addr_t is not an available 'typedefed' type. */
209 #define in_addr_t unsigned long
211 /* Define to the return type of signal handlers (int or void). */
212 #define RETSIGTYPE void
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__) || \
219 # elif defined(_WIN64)
220 # define _SSIZE_T_DEFINED
221 # define ssize_t __int64
223 # define _SSIZE_T_DEFINED
228 /* ---------------------------------------------------------------- */
230 /* ---------------------------------------------------------------- */
232 /* Define to the size of `int', as computed by sizeof. */
235 /* Define to the size of `short', as computed by sizeof. */
236 #define SIZEOF_SHORT 2
238 /* Define to the size of `size_t', as computed by sizeof. */
240 # define SIZEOF_SIZE_T 8
242 # define SIZEOF_SIZE_T 4
245 /* ---------------------------------------------------------------- */
247 /* ---------------------------------------------------------------- */
249 /* Define if you have struct addrinfo. */
250 #define HAVE_STRUCT_ADDRINFO 1
252 /* Define if you have struct sockaddr_storage. */
253 #if !defined(__SALFORDC__) && !defined(__BORLANDC__)
254 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
257 /* Define if you have struct timeval. */
258 #define HAVE_STRUCT_TIMEVAL 1
260 /* ---------------------------------------------------------------- */
261 /* COMPILER SPECIFIC */
262 /* ---------------------------------------------------------------- */
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
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
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
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
294 # define WINVER VS2008_DEF_TARGET
296 # if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
297 # error VS2008 does not support Windows build targets prior to Windows 2000
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
308 # define WINVER 0x0500
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
330 #if defined(__POCC__)
332 # error Microsoft extensions /Ze compiler option is required
334 # ifndef __POCC__OLDNAMES
335 # error Compatibility names /Go compiler option is required
339 /* ---------------------------------------------------------------- */
340 /* IPV6 COMPATIBILITY */
341 /* ---------------------------------------------------------------- */
343 /* Define if you have address family AF_INET6. */
344 #ifdef HAVE_WINSOCK2_H
345 #define HAVE_AF_INET6 1
348 /* Define if you have protocol family PF_INET6. */
349 #ifdef HAVE_WINSOCK2_H
350 #define HAVE_PF_INET6 1
353 /* Define if you have struct in6_addr. */
354 #ifdef HAVE_WS2TCPIP_H
355 #define HAVE_STRUCT_IN6_ADDR 1
358 /* Define if you have struct sockaddr_in6. */
359 #ifdef HAVE_WS2TCPIP_H
360 #define HAVE_STRUCT_SOCKADDR_IN6 1
363 /* Define if you have sockaddr_in6 with scopeid. */
364 #ifdef HAVE_WS2TCPIP_H
365 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
368 /* ---------------------------------------------------------------- */
370 /* ---------------------------------------------------------------- */
372 /* FIXME: A proper config-win32ce.h should be created to hold these */
375 * System error codes for Windows CE
378 #if defined(_WIN32_WCE) && !defined(HAVE_ERRNO_H)
379 # define ENOENT ERROR_FILE_NOT_FOUND
380 # define ESRCH ERROR_PATH_NOT_FOUND
381 # define ENOMEM ERROR_NOT_ENOUGH_MEMORY
382 # define ENOSPC ERROR_INVALID_PARAMETER
385 #endif /* HEADER_CARES_CONFIG_WIN32_H */