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 #ifdef __cplusplus
215 /* Compiling headers in C++ mode means bool is available */
216 #define HAVE_BOOL_T
217 #endif
218 
219 /* ---------------------------------------------------------------- */
220 /*                            TYPE SIZES                            */
221 /* ---------------------------------------------------------------- */
222 
223 /* ---------------------------------------------------------------- */
224 /*                          STRUCT RELATED                          */
225 /* ---------------------------------------------------------------- */
226 
227 /* Define if you have struct addrinfo. */
228 #define HAVE_STRUCT_ADDRINFO 1
229 
230 /* Define if you have struct sockaddr_storage. */
231 #if !defined(__SALFORDC__) && !defined(__BORLANDC__)
232 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
233 #endif
234 
235 /* Define if you have struct timeval. */
236 #define HAVE_STRUCT_TIMEVAL 1
237 
238 /* ---------------------------------------------------------------- */
239 /*                        COMPILER SPECIFIC                         */
240 /* ---------------------------------------------------------------- */
241 
242 /* Define to avoid VS2005 complaining about portable C functions. */
243 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
244 #  define _CRT_SECURE_NO_DEPRECATE 1
245 #  define _CRT_NONSTDC_NO_DEPRECATE 1
246 #endif
247 
248 /* Set the Target to Vista. However, any symbols required above Win2000
249  * should be loaded via LoadLibrary() */
250 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
251 #  define VS2008_MIN_TARGET 0x0600
252 #endif
253 
254 /* VS2008 default target settings and minimum build target check. */
255 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
256 #  ifndef _WIN32_WINNT
257 #    define _WIN32_WINNT VS2008_MIN_TARGET
258 #  endif
259 #  ifndef WINVER
260 #    define WINVER VS2008_MIN_TARGET
261 #  endif
262 #  if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
263 #    error VS2008 does not support Windows build targets prior to Windows 2000
264 #  endif
265 #endif
266 
267 /* When no build target is specified Pelles C 5.00 and later default build
268    target is Windows Vista. */
269 #if defined(__POCC__) && (__POCC__ >= 500)
270 #  ifndef _WIN32_WINNT
271 #    define _WIN32_WINNT 0x0600
272 #  endif
273 #  ifndef WINVER
274 #    define WINVER 0x0600
275 #  endif
276 #endif
277 
278 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
279    quite convoluted, compiler dependent and even build target dependent. */
280 #if defined(HAVE_WS2TCPIP_H)
281 #  if defined(__POCC__)
282 #    define HAVE_FREEADDRINFO 1
283 #    define HAVE_GETADDRINFO  1
284 #    define HAVE_GETNAMEINFO  1
285 #  elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
286 #    define HAVE_FREEADDRINFO 1
287 #    define HAVE_GETADDRINFO  1
288 #    define HAVE_GETNAMEINFO  1
289 #  elif defined(_MSC_VER) && (_MSC_VER >= 1200)
290 #    define HAVE_FREEADDRINFO 1
291 #    define HAVE_GETADDRINFO  1
292 #    define HAVE_GETNAMEINFO  1
293 #  endif
294 #endif
295 
296 #if defined(__POCC__)
297 #  ifndef _MSC_VER
298 #    error Microsoft extensions /Ze compiler option is required
299 #  endif
300 #  ifndef __POCC__OLDNAMES
301 #    error Compatibility names /Go compiler option is required
302 #  endif
303 #endif
304 
305 /* ---------------------------------------------------------------- */
306 /*                         IPV6 COMPATIBILITY                       */
307 /* ---------------------------------------------------------------- */
308 
309 /* Define if you have address family AF_INET6. */
310 #ifdef HAVE_WINSOCK2_H
311 #define HAVE_AF_INET6 1
312 #endif
313 
314 /* Define if you have protocol family PF_INET6. */
315 #ifdef HAVE_WINSOCK2_H
316 #define HAVE_PF_INET6 1
317 #endif
318 
319 /* Define if you have struct in6_addr. */
320 #ifdef HAVE_WS2TCPIP_H
321 #define HAVE_STRUCT_IN6_ADDR 1
322 #endif
323 
324 /* Define if you have struct sockaddr_in6. */
325 #ifdef HAVE_WS2TCPIP_H
326 #define HAVE_STRUCT_SOCKADDR_IN6 1
327 #endif
328 
329 /* Define if you have sockaddr_in6 with scopeid. */
330 #ifdef HAVE_WS2TCPIP_H
331 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
332 #endif
333 
334 /* ---------------------------------------------------------------- */
335 /*                              Win CE                              */
336 /* ---------------------------------------------------------------- */
337 
338 /* FIXME: A proper config-win32ce.h should be created to hold these */
339 
340 /*
341  *  System error codes for Windows CE
342  */
343 
344 #if defined(_WIN32_WCE) && !defined(HAVE_ERRNO_H)
345 #  define ENOENT    ERROR_FILE_NOT_FOUND
346 #  define ESRCH     ERROR_PATH_NOT_FOUND
347 #  define ENOMEM    ERROR_NOT_ENOUGH_MEMORY
348 #  define ENOSPC    ERROR_INVALID_PARAMETER
349 #endif
350 
351 #endif /* HEADER_CARES_CONFIG_WIN32_H */
352