remove all $Id$ lines
[platform/upstream/c-ares.git] / config-win32.h
1 #ifndef __ARES_CONFIG_WIN32_H
2 #define __ARES_CONFIG_WIN32_H
3
4
5 /* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
6  *
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.
16  */
17
18 /* ================================================================ */
19 /*    ares/config-win32.h - Hand crafted config file for Windows    */
20 /* ================================================================ */
21
22 /* ---------------------------------------------------------------- */
23 /*                          HEADER FILES                            */
24 /* ---------------------------------------------------------------- */
25
26 /* Define if you have the <getopt.h> header file.  */
27 #if defined(__MINGW32__) || defined(__POCC__)
28 #define HAVE_GETOPT_H 1
29 #endif
30
31 /* Define if you have the <limits.h> header file.  */
32 #define HAVE_LIMITS_H 1
33
34 /* Define if you have the <process.h> header file.  */
35 #ifndef __SALFORDC__
36 #define HAVE_PROCESS_H 1
37 #endif
38
39 /* Define if you have the <signal.h> header file. */
40 #define HAVE_SIGNAL_H 1
41
42 /* Define if you have the <sys/time.h> header file */
43 /* #define HAVE_SYS_TIME_H 1 */
44
45 /* Define if you have the <time.h> header file.  */
46 #define HAVE_TIME_H 1
47
48 /* Define if you have the <unistd.h> header file.  */
49 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
50     defined(__POCC__)
51 #define HAVE_UNISTD_H 1
52 #endif
53
54 /* Define if you have the <windows.h> header file.  */
55 #define HAVE_WINDOWS_H 1
56
57 /* Define if you have the <winsock.h> header file.  */
58 #define HAVE_WINSOCK_H 1
59
60 /* Define if you have the <winsock2.h> header file.  */
61 #ifndef __SALFORDC__
62 #define HAVE_WINSOCK2_H 1
63 #endif
64
65 /* Define if you have the <ws2tcpip.h> header file.  */
66 #ifndef __SALFORDC__
67 #define HAVE_WS2TCPIP_H 1
68 #endif
69
70 /* ---------------------------------------------------------------- */
71 /*                        OTHER HEADER INFO                         */
72 /* ---------------------------------------------------------------- */
73
74 /* Define if sig_atomic_t is an available typedef. */
75 #define HAVE_SIG_ATOMIC_T 1
76
77 /* Define if you have the ANSI C header files.  */
78 #define STDC_HEADERS 1
79
80 /* Define if you can safely include both <sys/time.h> and <time.h>.  */
81 /* #define TIME_WITH_SYS_TIME 1 */
82
83 /* ---------------------------------------------------------------- */
84 /*                             FUNCTIONS                            */
85 /* ---------------------------------------------------------------- */
86
87 /* Define if you have the closesocket function.  */
88 #define HAVE_CLOSESOCKET 1
89
90 /* Define if you have the gethostname function.  */
91 #define HAVE_GETHOSTNAME 1
92
93 /* Define if you have the ioctlsocket function. */
94 #define HAVE_IOCTLSOCKET 1
95
96 /* Define if you have a working ioctlsocket FIONBIO function. */
97 #define HAVE_IOCTLSOCKET_FIONBIO 1
98
99 /* Define if you have the strcasecmp function. */
100 /* #define HAVE_STRCASECMP 1 */
101
102 /* Define if you have the strdup function. */
103 #define HAVE_STRDUP 1
104
105 /* Define if you have the stricmp function. */
106 #define HAVE_STRICMP 1
107
108 /* Define if you have the strncasecmp function. */
109 /* #define HAVE_STRNCASECMP 1 */
110
111 /* Define if you have the strnicmp function. */
112 #define HAVE_STRNICMP 1
113
114 /* Define if you have the recv function. */
115 #define HAVE_RECV 1
116
117 /* Define to the type of arg 1 for recv. */
118 #define RECV_TYPE_ARG1 SOCKET
119
120 /* Define to the type of arg 2 for recv. */
121 #define RECV_TYPE_ARG2 char *
122
123 /* Define to the type of arg 3 for recv. */
124 #define RECV_TYPE_ARG3 int
125
126 /* Define to the type of arg 4 for recv. */
127 #define RECV_TYPE_ARG4 int
128
129 /* Define to the function return type for recv. */
130 #define RECV_TYPE_RETV int
131
132 /* Define if you have the recvfrom function. */
133 #define HAVE_RECVFROM 1
134
135 /* Define to the type of arg 1 for recvfrom. */
136 #define RECVFROM_TYPE_ARG1 SOCKET
137
138 /* Define to the type pointed by arg 2 for recvfrom. */
139 #define RECVFROM_TYPE_ARG2 char
140
141 /* Define to the type of arg 3 for recvfrom. */
142 #define RECVFROM_TYPE_ARG3 int
143
144 /* Define to the type of arg 4 for recvfrom. */
145 #define RECVFROM_TYPE_ARG4 int
146
147 /* Define to the type pointed by arg 5 for recvfrom. */
148 #define RECVFROM_TYPE_ARG5 struct sockaddr
149
150 /* Define to the type pointed by arg 6 for recvfrom. */
151 #define RECVFROM_TYPE_ARG6 int
152
153 /* Define to the function return type for recvfrom. */
154 #define RECVFROM_TYPE_RETV int
155
156 /* Define if you have the send function. */
157 #define HAVE_SEND 1
158
159 /* Define to the type of arg 1 for send. */
160 #define SEND_TYPE_ARG1 SOCKET
161
162 /* Define to the type qualifier of arg 2 for send. */
163 #define SEND_QUAL_ARG2 const
164
165 /* Define to the type of arg 2 for send. */
166 #define SEND_TYPE_ARG2 char *
167
168 /* Define to the type of arg 3 for send. */
169 #define SEND_TYPE_ARG3 int
170
171 /* Define to the type of arg 4 for send. */
172 #define SEND_TYPE_ARG4 int
173
174 /* Define to the function return type for send. */
175 #define SEND_TYPE_RETV int
176
177 /* Specifics for the Watt-32 tcp/ip stack */
178 #ifdef WATT32
179   #define SOCKET              int
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
194 #endif
195
196 /* ---------------------------------------------------------------- */
197 /*                       TYPEDEF REPLACEMENTS                       */
198 /* ---------------------------------------------------------------- */
199
200 /* Define this if in_addr_t is not an available 'typedefed' type */
201 #define in_addr_t unsigned long
202
203 /* Define as the return type of signal handlers (int or void).  */
204 #define RETSIGTYPE void
205
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__) || \
210       defined(__MINGW32__)
211 #  elif defined(_WIN64)
212 #    define _SSIZE_T_DEFINED
213 #    define ssize_t __int64
214 #  else
215 #    define _SSIZE_T_DEFINED
216 #    define ssize_t int
217 #  endif
218 #endif
219
220 /* ---------------------------------------------------------------- */
221 /*                            TYPE SIZES                            */
222 /* ---------------------------------------------------------------- */
223
224 /* The size of `int', as computed by sizeof. */
225 #define SIZEOF_INT 4
226
227 /* The size of `short', as computed by sizeof. */
228 #define SIZEOF_SHORT 2
229
230 /* ---------------------------------------------------------------- */
231 /*                          STRUCT RELATED                          */
232 /* ---------------------------------------------------------------- */
233
234 /* Define this if you have struct addrinfo */
235 #define HAVE_STRUCT_ADDRINFO 1
236
237 /* Define this if you have struct sockaddr_storage */
238 #ifndef __SALFORDC__
239 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
240 #endif
241
242 /* Define this if you have struct timeval */
243 #define HAVE_STRUCT_TIMEVAL 1
244
245 /* ---------------------------------------------------------------- */
246 /*                        COMPILER SPECIFIC                         */
247 /* ---------------------------------------------------------------- */
248
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
253 #endif
254
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
262 #endif
263
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
270 #endif
271
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
276 #  endif
277 #  ifndef WINVER
278 #    define WINVER VS2008_DEFAULT_TARGET
279 #  endif
280 #  if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
281 #    error VS2008 does not support Windows build targets prior to Windows 2000
282 #  endif
283 #endif
284
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
290 #  endif
291 #  ifndef WINVER
292 #    define WINVER 0x0500
293 #  endif
294 #endif
295
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
311 #  endif
312 #endif
313
314 #if defined(__POCC__)
315 #  ifndef _MSC_VER
316 #    error Microsoft extensions /Ze compiler option is required
317 #  endif
318 #  ifndef __POCC__OLDNAMES
319 #    error Compatibility names /Go compiler option is required
320 #  endif
321 #endif
322
323 /* ---------------------------------------------------------------- */
324 /*                         IPV6 COMPATIBILITY                       */
325 /* ---------------------------------------------------------------- */
326
327 /* Define this if you have address family AF_INET6 */
328 #ifdef HAVE_WINSOCK2_H
329 #define HAVE_AF_INET6 1
330 #endif
331
332 /* Define this if you have protocol family PF_INET6 */
333 #ifdef HAVE_WINSOCK2_H
334 #define HAVE_PF_INET6 1
335 #endif
336
337 /* Define this if you have struct in6_addr */
338 #ifdef HAVE_WS2TCPIP_H
339 #define HAVE_STRUCT_IN6_ADDR 1
340 #endif
341
342 /* Define this if you have struct sockaddr_in6 */
343 #ifdef HAVE_WS2TCPIP_H
344 #define HAVE_STRUCT_SOCKADDR_IN6 1
345 #endif
346
347 /* Define this if you have sockaddr_in6 with scopeid */
348 #ifdef HAVE_WS2TCPIP_H
349 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
350 #endif
351
352
353 #endif  /* __ARES_CONFIG_WIN32_H */