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