blob: dd955252bdf574e97c8811c26893cfdf8ae3c91d [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#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/* Define if ssize_t is not an available 'typedefed' type. */
220#ifndef _SSIZE_T_DEFINED
221# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
222 defined(__POCC__) || \
223 defined(__MINGW32__)
224# elif defined(_WIN64)
225# define _SSIZE_T_DEFINED
226# define ssize_t __int64
227# else
228# define _SSIZE_T_DEFINED
229# define ssize_t int
230# endif
231#endif
232
233/* ---------------------------------------------------------------- */
234/* TYPE SIZES */
235/* ---------------------------------------------------------------- */
236
237/* ---------------------------------------------------------------- */
238/* STRUCT RELATED */
239/* ---------------------------------------------------------------- */
240
241/* Define if you have struct addrinfo. */
242#define HAVE_STRUCT_ADDRINFO 1
243
244/* Define if you have struct sockaddr_storage. */
245#if !defined(__SALFORDC__) && !defined(__BORLANDC__)
246#define HAVE_STRUCT_SOCKADDR_STORAGE 1
247#endif
248
249/* Define if you have struct timeval. */
250#define HAVE_STRUCT_TIMEVAL 1
251
252/* ---------------------------------------------------------------- */
253/* COMPILER SPECIFIC */
254/* ---------------------------------------------------------------- */
255
256/* Define to avoid VS2005 complaining about portable C functions. */
257#if defined(_MSC_VER) && (_MSC_VER >= 1400)
258# define _CRT_SECURE_NO_DEPRECATE 1
259# define _CRT_NONSTDC_NO_DEPRECATE 1
260#endif
261
262/* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
263 2000 as a supported build target. VS2008 default installations provide
264 an embedded Windows SDK v6.0A along with the claim that Windows 2000 is
265 a valid build target for VS2008. Popular belief is that binaries built
266 with VS2008 using Windows SDK versions 6.X and Windows 2000 as a build
267 target are functional. */
268#if defined(_MSC_VER) && (_MSC_VER >= 1500)
269# define VS2008_MIN_TARGET 0x0500
270#endif
271
272/* When no build target is specified VS2008 default build target is Windows
273 Vista, which leaves out even Winsows XP. If no build target has been given
274 for VS2008 we will target the minimum Officially supported build target,
275 which happens to be Windows XP. */
276#if defined(_MSC_VER) && (_MSC_VER >= 1500)
277# define VS2008_DEF_TARGET 0x0501
278#endif
279
280/* VS2008 default target settings and minimum build target check. */
281#if defined(_MSC_VER) && (_MSC_VER >= 1500)
282# ifndef _WIN32_WINNT
283# define _WIN32_WINNT VS2008_DEF_TARGET
284# endif
285# ifndef WINVER
286# define WINVER VS2008_DEF_TARGET
287# endif
288# if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
289# error VS2008 does not support Windows build targets prior to Windows 2000
290# endif
291#endif
292
293/* When no build target is specified Pelles C 5.00 and later default build
294 target is Windows Vista. We override default target to be Windows 2000. */
295#if defined(__POCC__) && (__POCC__ >= 500)
296# ifndef _WIN32_WINNT
297# define _WIN32_WINNT 0x0500
298# endif
299# ifndef WINVER
300# define WINVER 0x0500
301# endif
302#endif
303
304/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
305 quite convoluted, compiler dependent and even build target dependent. */
306#if defined(HAVE_WS2TCPIP_H)
307# if defined(__POCC__)
308# define HAVE_FREEADDRINFO 1
309# define HAVE_GETADDRINFO 1
310# define HAVE_GETNAMEINFO 1
311# elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
312# define HAVE_FREEADDRINFO 1
313# define HAVE_GETADDRINFO 1
314# define HAVE_GETNAMEINFO 1
315# elif defined(_MSC_VER) && (_MSC_VER >= 1200)
316# define HAVE_FREEADDRINFO 1
317# define HAVE_GETADDRINFO 1
318# define HAVE_GETNAMEINFO 1
319# endif
320#endif
321
322#if defined(__POCC__)
323# ifndef _MSC_VER
324# error Microsoft extensions /Ze compiler option is required
325# endif
326# ifndef __POCC__OLDNAMES
327# error Compatibility names /Go compiler option is required
328# endif
329#endif
330
331/* ---------------------------------------------------------------- */
332/* IPV6 COMPATIBILITY */
333/* ---------------------------------------------------------------- */
334
335/* Define if you have address family AF_INET6. */
336#ifdef HAVE_WINSOCK2_H
337#define HAVE_AF_INET6 1
338#endif
339
340/* Define if you have protocol family PF_INET6. */
341#ifdef HAVE_WINSOCK2_H
342#define HAVE_PF_INET6 1
343#endif
344
345/* Define if you have struct in6_addr. */
346#ifdef HAVE_WS2TCPIP_H
347#define HAVE_STRUCT_IN6_ADDR 1
348#endif
349
350/* Define if you have struct sockaddr_in6. */
351#ifdef HAVE_WS2TCPIP_H
352#define HAVE_STRUCT_SOCKADDR_IN6 1
353#endif
354
355/* Define if you have sockaddr_in6 with scopeid. */
356#ifdef HAVE_WS2TCPIP_H
357#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
358#endif
359
360/* ---------------------------------------------------------------- */
361/* Win CE */
362/* ---------------------------------------------------------------- */
363
364/* FIXME: A proper config-win32ce.h should be created to hold these */
365
366/*
367 * System error codes for Windows CE
368 */
369
370#if defined(_WIN32_WCE) && !defined(HAVE_ERRNO_H)
371# define ENOENT ERROR_FILE_NOT_FOUND
372# define ESRCH ERROR_PATH_NOT_FOUND
373# define ENOMEM ERROR_NOT_ENOUGH_MEMORY
374# define ENOSPC ERROR_INVALID_PARAMETER
375#endif
376
377#endif /* HEADER_CARES_CONFIG_WIN32_H */