Do not halt compilation when using VS2008 to build a Windows 2000 target
[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__)
29 #define HAVE_GETOPT_H 1
30 #endif
31
32 /* Define if you have the <signal.h> header file. */
33 #define HAVE_SIGNAL_H 1
34
35 /* Define if you have the <sys/time.h> header file */
36 /* #define HAVE_SYS_TIME_H 1 */
37
38 /* Define if you have the <time.h> header file.  */
39 #define HAVE_TIME_H 1
40
41 /* Define if you have the <process.h> header file.  */
42 #define HAVE_PROCESS_H 1
43
44 /* Define if you have the <unistd.h> header file.  */
45 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
46     defined(__POCC__)
47 #define HAVE_UNISTD_H 1
48 #endif
49
50 /* Define if you have the <windows.h> header file.  */
51 #define HAVE_WINDOWS_H 1
52
53 /* Define if you have the <winsock.h> header file.  */
54 #define HAVE_WINSOCK_H 1
55
56 /* Define if you have the <winsock2.h> header file.  */
57 #define HAVE_WINSOCK2_H 1
58
59 /* Define if you have the <ws2tcpip.h> header file.  */
60 #define HAVE_WS2TCPIP_H 1
61
62 /* ---------------------------------------------------------------- */
63 /*                        OTHER HEADER INFO                         */
64 /* ---------------------------------------------------------------- */
65
66 /* Define if sig_atomic_t is an available typedef. */
67 #define HAVE_SIG_ATOMIC_T 1
68
69 /* Define if you have the ANSI C header files.  */
70 #define STDC_HEADERS 1
71
72 /* Define if you can safely include both <sys/time.h> and <time.h>.  */
73 /* #define TIME_WITH_SYS_TIME 1 */
74
75 /* ---------------------------------------------------------------- */
76 /*                             FUNCTIONS                            */
77 /* ---------------------------------------------------------------- */
78
79 /* Define if you have the ioctlsocket function. */
80 #define HAVE_IOCTLSOCKET 1
81
82 /* Define if you have a working ioctlsocket FIONBIO function. */
83 #define HAVE_IOCTLSOCKET_FIONBIO 1
84
85 /* Define if you have the strcasecmp function. */
86 /* #define HAVE_STRCASECMP 1 */
87
88 /* Define if you have the strdup function. */
89 #define HAVE_STRDUP 1
90
91 /* Define if you have the stricmp function. */
92 #define HAVE_STRICMP 1
93
94 /* Define if you have the strncasecmp function. */
95 /* #define HAVE_STRNCASECMP 1 */
96
97 /* Define if you have the strnicmp function. */
98 #define HAVE_STRNICMP 1
99
100 /* Define if you have the gethostname function.  */
101 #define HAVE_GETHOSTNAME 1
102
103 /* Define if you have the recv function. */
104 #define HAVE_RECV 1
105
106 /* Define to the type of arg 1 for recv. */
107 #define RECV_TYPE_ARG1 SOCKET
108
109 /* Define to the type of arg 2 for recv. */
110 #define RECV_TYPE_ARG2 char *
111
112 /* Define to the type of arg 3 for recv. */
113 #define RECV_TYPE_ARG3 int
114
115 /* Define to the type of arg 4 for recv. */
116 #define RECV_TYPE_ARG4 int
117
118 /* Define to the function return type for recv. */
119 #define RECV_TYPE_RETV int
120
121 /* Define if you have the recvfrom function. */
122 #define HAVE_RECVFROM 1
123
124 /* Define to the type of arg 1 for recvfrom. */
125 #define RECVFROM_TYPE_ARG1 SOCKET
126
127 /* Define to the type pointed by arg 2 for recvfrom. */
128 #define RECVFROM_TYPE_ARG2 char
129
130 /* Define to the type of arg 3 for recvfrom. */
131 #define RECVFROM_TYPE_ARG3 int
132
133 /* Define to the type of arg 4 for recvfrom. */
134 #define RECVFROM_TYPE_ARG4 int
135
136 /* Define to the type pointed by arg 5 for recvfrom. */
137 #define RECVFROM_TYPE_ARG5 struct sockaddr
138
139 /* Define to the type pointed by arg 6 for recvfrom. */
140 #define RECVFROM_TYPE_ARG6 int
141
142 /* Define to the function return type for recvfrom. */
143 #define RECVFROM_TYPE_RETV int
144
145 /* Define if you have the send function. */
146 #define HAVE_SEND 1
147
148 /* Define to the type of arg 1 for send. */
149 #define SEND_TYPE_ARG1 SOCKET
150
151 /* Define to the type qualifier of arg 2 for send. */
152 #define SEND_QUAL_ARG2 const
153
154 /* Define to the type of arg 2 for send. */
155 #define SEND_TYPE_ARG2 char *
156
157 /* Define to the type of arg 3 for send. */
158 #define SEND_TYPE_ARG3 int
159
160 /* Define to the type of arg 4 for send. */
161 #define SEND_TYPE_ARG4 int
162
163 /* Define to the function return type for send. */
164 #define SEND_TYPE_RETV int
165
166 /* Specifics for the Watt-32 tcp/ip stack */
167 #ifdef WATT32
168   #define SOCKET              int
169   #define NS_INADDRSZ         4
170   #define HAVE_ARPA_NAMESER_H 1
171   #define HAVE_ARPA_INET_H    1
172   #define HAVE_NETDB_H        1
173   #define HAVE_NETINET_IN_H   1
174   #define HAVE_SYS_SOCKET_H   1
175   #define HAVE_NETINET_TCP_H  1
176   #define HAVE_AF_INET6       1
177   #define HAVE_PF_INET6       1
178   #define HAVE_STRUCT_IN6_ADDR     1
179   #define HAVE_STRUCT_SOCKADDR_IN6 1
180   #undef HAVE_WINSOCK_H
181   #undef HAVE_WINSOCK2_H
182   #undef HAVE_WS2TCPIP_H
183 #endif
184
185 /* ---------------------------------------------------------------- */
186 /*                       TYPEDEF REPLACEMENTS                       */
187 /* ---------------------------------------------------------------- */
188
189 /* Define this if in_addr_t is not an available 'typedefed' type */
190 #define in_addr_t unsigned long
191
192 /* Define as the return type of signal handlers (int or void).  */
193 #define RETSIGTYPE void
194
195 /* Define ssize_t if it is not an available 'typedefed' type */
196 #if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__)
197 #elif defined(_WIN64)
198 #define ssize_t __int64
199 #else
200 #define ssize_t int
201 #endif
202
203 /* ---------------------------------------------------------------- */
204 /*                          STRUCT RELATED                          */
205 /* ---------------------------------------------------------------- */
206
207 /* Define this if you have struct addrinfo */
208 #define HAVE_STRUCT_ADDRINFO 1
209
210 /* Define this if you have struct sockaddr_storage */
211 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
212
213 /* Define this if you have struct timeval */
214 #define HAVE_STRUCT_TIMEVAL 1
215
216 /* ---------------------------------------------------------------- */
217 /*                        COMPILER SPECIFIC                         */
218 /* ---------------------------------------------------------------- */
219
220 /* Define to avoid VS2005 complaining about portable C functions */
221 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
222 #define _CRT_SECURE_NO_DEPRECATE 1
223 #define _CRT_NONSTDC_NO_DEPRECATE 1
224 #endif
225
226 /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
227    2000 as a supported build target. VS2008 default installations provide an
228    embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
229    valid build target for VS2008. Popular belief is that binaries built using
230    Windows SDK versions 6.X and Windows 2000 as a build target are functional */
231 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
232 #  define VS2008_MINIMUM_TARGET 0x0500
233 #endif
234
235 /* When no build target is specified VS2008 default build target is Windows
236    Vista, which leaves out even Winsows XP. If no build target has been given
237    for VS2008 we will target the minimum Officially supported build target,
238    which happens to be Windows XP. */
239 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
240 #  define VS2008_DEFAULT_TARGET  0x0501
241 #endif
242
243 /* VS2008 default target settings and minimum build target check */
244 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
245 #  ifndef _WIN32_WINNT
246 #    define _WIN32_WINNT VS2008_DEFAULT_TARGET
247 #  endif
248 #  ifndef WINVER
249 #    define WINVER VS2008_DEFAULT_TARGET
250 #  endif
251 #  if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
252 #    error VS2008 does not support Windows build targets prior to Windows 2000
253 #  endif
254 #endif
255
256 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is quite */
257 /* convoluted, compiler dependant and in some cases even build target dependat. */
258 #if defined(HAVE_WS2TCPIP_H)
259 #  if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
260 #    define HAVE_FREEADDRINFO 1
261 #    define HAVE_GETADDRINFO  1
262 #    define HAVE_GETNAMEINFO  1
263 #  elif defined(_MSC_VER) && (_MSC_VER >= 1200)
264 #    define HAVE_FREEADDRINFO 1
265 #    define HAVE_GETADDRINFO  1
266 #    define HAVE_GETNAMEINFO  1
267 #  endif
268 #endif
269
270 /* ---------------------------------------------------------------- */
271 /*                         IPV6 COMPATIBILITY                       */
272 /* ---------------------------------------------------------------- */
273
274 /* Define this if you have address family AF_INET6 */
275 #ifdef HAVE_WINSOCK2_H
276 #define HAVE_AF_INET6 1
277 #endif
278
279 /* Define this if you have protocol family PF_INET6 */
280 #ifdef HAVE_WINSOCK2_H
281 #define HAVE_PF_INET6 1
282 #endif
283
284 /* Define this if you have struct in6_addr */
285 #ifdef HAVE_WS2TCPIP_H
286 #define HAVE_STRUCT_IN6_ADDR 1
287 #endif
288
289 /* Define this if you have struct sockaddr_in6 */
290 #ifdef HAVE_WS2TCPIP_H
291 #define HAVE_STRUCT_SOCKADDR_IN6 1
292 #endif
293
294 /* Define this if you have sockaddr_in6 with scopeid */
295 #ifdef HAVE_WS2TCPIP_H
296 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
297 #endif
298
299
300 #endif  /* __ARES_CONFIG_WIN32_H */