Fix Pelles C Win32 target compilation issues
[platform/upstream/curl.git] / lib / config-win32.h
1 #ifndef __LIB_CONFIG_WIN32_H
2 #define __LIB_CONFIG_WIN32_H
3
4 /* ================================================================ */
5 /*    lib/config-win32.h - Hand crafted config file for Windows     */
6 /* ================================================================ */
7
8 /* ---------------------------------------------------------------- */
9 /*                          HEADER FILES                            */
10 /* ---------------------------------------------------------------- */
11
12 /* Define if you have the <arpa/inet.h> header file.  */
13 /* #define HAVE_ARPA_INET_H 1 */
14
15 /* Define if you have the <assert.h> header file.  */
16 #define HAVE_ASSERT_H 1
17
18 /* Define if you have the <crypto.h> header file.  */
19 /* #define HAVE_CRYPTO_H 1 */
20
21 /* Define if you have the <err.h> header file.  */
22 /* #define HAVE_ERR_H 1 */
23
24 /* Define if you have the <fcntl.h> header file.  */
25 #define HAVE_FCNTL_H 1
26
27 /* Define if you have the <getopt.h> header file.  */
28 /* #define HAVE_GETOPT_H 1 */
29
30 /* Define if you have the <io.h> header file.  */
31 #define HAVE_IO_H 1
32
33 /* Define if you have the <limits.h> header file.  */
34 #define HAVE_LIMITS_H 1
35
36 /* Define if you need the malloc.h header file even with stdlib.h  */
37 #if !defined(__SALFORDC__) && !defined(__POCC__)
38 #define NEED_MALLOC_H 1
39 #endif
40
41 /* Define if you have the <netdb.h> header file.  */
42 /* #define HAVE_NETDB_H 1 */
43
44 /* Define if you have the <netinet/in.h> header file.  */
45 /* #define HAVE_NETINET_IN_H 1 */
46
47 /* Define if you have the <process.h> header file.  */
48 #ifndef __SALFORDC__
49 #define HAVE_PROCESS_H 1
50 #endif
51
52 /* Define if you have the <signal.h> header file. */
53 #define HAVE_SIGNAL_H 1
54
55 /* Define if you have the <sgtty.h> header file.  */
56 /* #define HAVE_SGTTY_H 1 */
57
58 /* Define if you have the <ssl.h> header file.  */
59 /* #define HAVE_SSL_H 1 */
60
61 /* Define if you have the <stdlib.h> header file.  */
62 #define HAVE_STDLIB_H 1
63
64 /* Define if you have the <sys/param.h> header file.  */
65 /* #define HAVE_SYS_PARAM_H 1 */
66
67 /* Define if you have the <sys/select.h> header file.  */
68 /* #define HAVE_SYS_SELECT_H 1 */
69
70 /* Define if you have the <sys/socket.h> header file.  */
71 /* #define HAVE_SYS_SOCKET_H 1 */
72
73 /* Define if you have the <sys/sockio.h> header file.  */
74 /* #define HAVE_SYS_SOCKIO_H 1 */
75
76 /* Define if you have the <sys/stat.h> header file.  */
77 #define HAVE_SYS_STAT_H 1
78
79 /* Define if you have the <sys/time.h> header file */
80 /* #define HAVE_SYS_TIME_H 1 */
81
82 /* Define if you have the <sys/types.h> header file.  */
83 #define HAVE_SYS_TYPES_H 1
84
85 /* Define if you have the <sys/utime.h> header file.  */
86 #ifndef __BORLANDC__
87 #define HAVE_SYS_UTIME_H 1
88 #endif
89
90 /* Define if you have the <termio.h> header file.  */
91 /* #define HAVE_TERMIO_H 1 */
92
93 /* Define if you have the <termios.h> header file.  */
94 /* #define HAVE_TERMIOS_H 1 */
95
96 /* Define if you have the <time.h> header file.  */
97 #define HAVE_TIME_H 1
98
99 /* Define if you have the <unistd.h> header file.  */
100 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
101     defined(__POCC__)
102 #define HAVE_UNISTD_H 1
103 #endif
104
105 /* Define if you have the <windows.h> header file.  */
106 #define HAVE_WINDOWS_H 1
107
108 /* Define if you have the <winsock.h> header file.  */
109 #define HAVE_WINSOCK_H 1
110
111 /* Define if you have the <winsock2.h> header file.  */
112 #ifndef __SALFORDC__
113 #define HAVE_WINSOCK2_H 1
114 #endif
115
116 /* Define if you have the <ws2tcpip.h> header file.  */
117 #ifndef __SALFORDC__
118 #define HAVE_WS2TCPIP_H 1
119 #endif
120
121 /* ---------------------------------------------------------------- */
122 /*                        OTHER HEADER INFO                         */
123 /* ---------------------------------------------------------------- */
124
125 /* Define if sig_atomic_t is an available typedef. */
126 #define HAVE_SIG_ATOMIC_T 1
127
128 /* Define if you have the ANSI C header files.  */
129 #define STDC_HEADERS 1
130
131 /* Define if you can safely include both <sys/time.h> and <time.h>.  */
132 /* #define TIME_WITH_SYS_TIME 1 */
133
134 /* ---------------------------------------------------------------- */
135 /*                             FUNCTIONS                            */
136 /* ---------------------------------------------------------------- */
137
138 /* Define if you have the closesocket function.  */
139 #define HAVE_CLOSESOCKET 1
140
141 /* Define if you don't have vprintf but do have _doprnt.  */
142 /* #define HAVE_DOPRNT 1 */
143
144 /* Define if you have the gethostbyaddr function.  */
145 #define HAVE_GETHOSTBYADDR 1
146
147 /* Define if you have the gethostname function.  */
148 #define HAVE_GETHOSTNAME 1
149
150 /* Define if you have the getpass function.  */
151 /* #define HAVE_GETPASS 1 */
152
153 /* Define if you have the getservbyname function.  */
154 #define HAVE_GETSERVBYNAME 1
155
156 /* Define if you have the getprotobyname function.  */
157 #define HAVE_GETPROTOBYNAME
158
159 /* Define if you have the gettimeofday function.  */
160 /* #define HAVE_GETTIMEOFDAY 1 */
161
162 /* Define if you have the inet_addr function.  */
163 #define HAVE_INET_ADDR 1
164
165 /* Define if you have the ioctlsocket function. */
166 #define HAVE_IOCTLSOCKET 1
167
168 /* Define if you have a working ioctlsocket FIONBIO function. */
169 #define HAVE_IOCTLSOCKET_FIONBIO 1
170
171 /* Define if you have the perror function.  */
172 #define HAVE_PERROR 1
173
174 /* Define if you have the RAND_screen function when using SSL  */
175 #define HAVE_RAND_SCREEN 1
176
177 /* Define if you have the `RAND_status' function when using SSL. */
178 #define HAVE_RAND_STATUS 1
179
180 /* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function.
181    This is present in OpenSSL versions after 0.9.6b */
182 #define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1
183
184 /* Define if you have the select function.  */
185 #define HAVE_SELECT 1
186
187 /* Define if you have the setvbuf function.  */
188 #define HAVE_SETVBUF 1
189
190 /* Define if you have the socket function.  */
191 #define HAVE_SOCKET 1
192
193 /* Define if you have the strcasecmp function.  */
194 /* #define HAVE_STRCASECMP 1 */
195
196 /* Define if you have the strdup function.  */
197 #define HAVE_STRDUP 1
198
199 /* Define if you have the strftime function.  */
200 #define HAVE_STRFTIME 1
201
202 /* Define if you have the stricmp function. */
203 #define HAVE_STRICMP 1
204
205 /* Define if you have the strncasecmp function. */
206 /* #define HAVE_STRNCASECMP 1 */
207
208 /* Define if you have the strnicmp function. */
209 #define HAVE_STRNICMP 1
210
211 /* Define if you have the strstr function.  */
212 #define HAVE_STRSTR 1
213
214 /* Define if you have the strtoll function.  */
215 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__POCC__)
216 #define HAVE_STRTOLL 1
217 #endif
218
219 /* Define if you have the tcgetattr function.  */
220 /* #define HAVE_TCGETATTR 1 */
221
222 /* Define if you have the tcsetattr function.  */
223 /* #define HAVE_TCSETATTR 1 */
224
225 /* Define if you have the utime function */
226 #ifndef __BORLANDC__
227 #define HAVE_UTIME 1
228 #endif
229
230 /* Define to the type qualifier of arg 1 for getnameinfo. */
231 #define GETNAMEINFO_QUAL_ARG1 const
232
233 /* Define to the type of arg 1 for getnameinfo. */
234 #define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
235
236 /* Define to the type of arg 2 for getnameinfo. */
237 #define GETNAMEINFO_TYPE_ARG2 socklen_t
238
239 /* Define to the type of args 4 and 6 for getnameinfo. */
240 #define GETNAMEINFO_TYPE_ARG46 DWORD
241
242 /* Define to the type of arg 7 for getnameinfo. */
243 #define GETNAMEINFO_TYPE_ARG7 int
244
245 /* Define if you have the recv function. */
246 #define HAVE_RECV 1
247
248 /* Define to the type of arg 1 for recv. */
249 #define RECV_TYPE_ARG1 SOCKET
250
251 /* Define to the type of arg 2 for recv. */
252 #define RECV_TYPE_ARG2 char *
253
254 /* Define to the type of arg 3 for recv. */
255 #define RECV_TYPE_ARG3 int
256
257 /* Define to the type of arg 4 for recv. */
258 #define RECV_TYPE_ARG4 int
259
260 /* Define to the function return type for recv. */
261 #define RECV_TYPE_RETV int
262
263 /* Define if you have the recvfrom function. */
264 #define HAVE_RECVFROM 1
265
266 /* Define to the type of arg 1 for recvfrom. */
267 #define RECVFROM_TYPE_ARG1 SOCKET
268
269 /* Define to the type pointed by arg 2 for recvfrom. */
270 #define RECVFROM_TYPE_ARG2 char
271
272 /* Define to the type of arg 3 for recvfrom. */
273 #define RECVFROM_TYPE_ARG3 int
274
275 /* Define to the type of arg 4 for recvfrom. */
276 #define RECVFROM_TYPE_ARG4 int
277
278 /* Define to the type pointed by arg 5 for recvfrom. */
279 #define RECVFROM_TYPE_ARG5 struct sockaddr
280
281 /* Define to the type pointed by arg 6 for recvfrom. */
282 #define RECVFROM_TYPE_ARG6 int
283
284 /* Define to the function return type for recvfrom. */
285 #define RECVFROM_TYPE_RETV int
286
287 /* Define if you have the send function. */
288 #define HAVE_SEND 1
289
290 /* Define to the type of arg 1 for send. */
291 #define SEND_TYPE_ARG1 SOCKET
292
293 /* Define to the type qualifier of arg 2 for send. */
294 #define SEND_QUAL_ARG2 const
295
296 /* Define to the type of arg 2 for send. */
297 #define SEND_TYPE_ARG2 char *
298
299 /* Define to the type of arg 3 for send. */
300 #define SEND_TYPE_ARG3 int
301
302 /* Define to the type of arg 4 for send. */
303 #define SEND_TYPE_ARG4 int
304
305 /* Define to the function return type for send. */
306 #define SEND_TYPE_RETV int
307
308 /* ---------------------------------------------------------------- */
309 /*                       TYPEDEF REPLACEMENTS                       */
310 /* ---------------------------------------------------------------- */
311
312 /* Define this if in_addr_t is not an available 'typedefed' type */
313 #define in_addr_t unsigned long
314
315 /* Define as the return type of signal handlers (int or void).  */
316 #define RETSIGTYPE void
317
318 /* Define ssize_t if it is not an available 'typedefed' type */
319 #ifndef _SSIZE_T_DEFINED
320 #  if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
321       defined(__POCC__) || \
322       defined(__MINGW32__)
323 #  elif defined(_WIN64)
324 #    define _SSIZE_T_DEFINED
325 #    define ssize_t __int64
326 #  else
327 #    define _SSIZE_T_DEFINED
328 #    define ssize_t int
329 #  endif
330 #endif
331
332 /* ---------------------------------------------------------------- */
333 /*                            TYPE SIZES                            */
334 /* ---------------------------------------------------------------- */
335
336 /* The number of bytes in a long double.  */
337 #define SIZEOF_LONG_DOUBLE 16
338
339 /* The number of bytes in a long long.  */
340 /* #define SIZEOF_LONG_LONG 8 */
341
342 /* ---------------------------------------------------------------- */
343 /*                          STRUCT RELATED                          */
344 /* ---------------------------------------------------------------- */
345
346 /* Define this if you have struct sockaddr_storage */
347 #ifndef __SALFORDC__
348 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
349 #endif
350
351 /* Define this if you have struct timeval */
352 #define HAVE_STRUCT_TIMEVAL 1
353
354 /* ---------------------------------------------------------------- */
355 /*                        Watt-32 tcp/ip SPECIFIC                   */
356 /* ---------------------------------------------------------------- */
357
358 #ifdef USE_WATT32
359   #include <tcp.h>
360   #undef byte
361   #undef word
362   #undef USE_WINSOCK
363   #undef HAVE_WINSOCK_H
364   #undef HAVE_WINSOCK2_H
365   #undef HAVE_WS2TCPIP_H
366   #define HAVE_GETADDRINFO
367   #define HAVE_GETNAMEINFO
368   #define HAVE_SYS_IOCTL_H
369   #define HAVE_SYS_SOCKET_H
370   #define HAVE_NETINET_IN_H
371   #define HAVE_NETDB_H
372   #define HAVE_ARPA_INET_H
373   #define HAVE_FREEADDRINFO
374   #define SOCKET int
375 #endif
376
377
378 /* ---------------------------------------------------------------- */
379 /*                        COMPILER SPECIFIC                         */
380 /* ---------------------------------------------------------------- */
381
382 /* Undef keyword 'const' if it does not work.  */
383 /* #undef const */
384
385 /* Windows should not have HAVE_GMTIME_R defined */
386 /* #undef HAVE_GMTIME_R */
387
388 /* Define if the compiler supports C99 variadic macro style. */
389 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
390 #define HAVE_VARIADIC_MACROS_C99 1
391 #endif
392
393 /* Define if the compiler supports the 'long long' data type. */
394 #if defined(__MINGW32__) || defined(__WATCOMC__)
395 #define HAVE_LONGLONG 1
396 #endif
397
398 /* Define to avoid VS2005 complaining about portable C functions */
399 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
400 #define _CRT_SECURE_NO_DEPRECATE 1
401 #define _CRT_NONSTDC_NO_DEPRECATE 1
402 #endif
403
404 /* VS2005 and later dafault size for time_t is 64-bit, unless */
405 /* _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */
406 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
407 #  ifndef _USE_32BIT_TIME_T
408 #    define SIZEOF_TIME_T 8
409 #  else
410 #    define SIZEOF_TIME_T 4
411 #  endif
412 #endif
413
414 /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
415    2000 as a supported build target. VS2008 default installations provide an
416    embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
417    valid build target for VS2008. Popular belief is that binaries built using
418    Windows SDK versions 6.X and Windows 2000 as a build target are functional */
419 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
420 #  define VS2008_MINIMUM_TARGET 0x0500
421 #endif
422
423 /* When no build target is specified VS2008 default build target is Windows
424    Vista, which leaves out even Winsows XP. If no build target has been given
425    for VS2008 we will target the minimum Officially supported build target,
426    which happens to be Windows XP. */
427 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
428 #  define VS2008_DEFAULT_TARGET  0x0501
429 #endif
430
431 /* VS2008 default target settings and minimum build target check */
432 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
433 #  ifndef _WIN32_WINNT
434 #    define _WIN32_WINNT VS2008_DEFAULT_TARGET
435 #  endif
436 #  ifndef WINVER
437 #    define WINVER VS2008_DEFAULT_TARGET
438 #  endif
439 #  if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
440 #    error VS2008 does not support Windows build targets prior to Windows 2000
441 #  endif
442 #endif
443
444 /* When no build target is specified Pelles C 5.00 and later default build
445    target is Windows Vista. We override default target to be Windows 2000. */
446 #if defined(__POCC__) && (__POCC__ >= 500)
447 #  ifndef _WIN32_WINNT
448 #    define _WIN32_WINNT 0x0500
449 #  endif
450 #  ifndef WINVER
451 #    define WINVER 0x0500
452 #  endif
453 #endif
454
455 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
456    quite convoluted, compiler dependent and even build target dependent. */
457 #if defined(HAVE_WS2TCPIP_H)
458 #  if defined(__POCC__)
459 #    define HAVE_FREEADDRINFO 1
460 #    define HAVE_GETADDRINFO  1
461 #    define HAVE_GETNAMEINFO  1
462 #  elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
463 #    define HAVE_FREEADDRINFO 1
464 #    define HAVE_GETADDRINFO  1
465 #    define HAVE_GETNAMEINFO  1
466 #  elif defined(_MSC_VER) && (_MSC_VER >= 1200)
467 #    define HAVE_FREEADDRINFO 1
468 #    define HAVE_GETADDRINFO  1
469 #    define HAVE_GETNAMEINFO  1
470 #  endif
471 #endif
472
473 #if defined(__POCC__)
474 #  ifndef _MSC_VER
475 #    error Microsoft extensions /Ze compiler option is required
476 #  endif
477 #  ifndef __POCC__OLDNAMES
478 #    error Compatibility names /Go compiler option is required
479 #  endif
480 #endif
481
482 /* ---------------------------------------------------------------- */
483 /*                        LARGE FILE SUPPORT                        */
484 /* ---------------------------------------------------------------- */
485
486 #if defined(_MSC_VER) && !defined(_WIN32_WCE)
487 #  if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
488 #    define USE_WIN32_LARGE_FILES
489 #  else
490 #    define USE_WIN32_SMALL_FILES
491 #  endif
492 #endif
493
494 #if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
495 #  define USE_WIN32_LARGE_FILES
496 #endif
497
498 #if defined(__POCC__)
499 #  undef USE_WIN32_LARGE_FILES
500 #endif
501
502 #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
503 #  define USE_WIN32_SMALL_FILES
504 #endif
505
506 /* ---------------------------------------------------------------- */
507 /*                           LDAP SUPPORT                           */
508 /* ---------------------------------------------------------------- */
509
510 #if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK)
511 #undef CURL_LDAP_HYBRID
512 #undef CURL_LDAP_WIN
513 #define HAVE_LDAP_SSL_H 1
514 #define HAVE_LDAP_URL_PARSE 1
515 #elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
516 #undef CURL_LDAP_HYBRID
517 #undef CURL_LDAP_WIN
518 #define HAVE_LDAP_URL_PARSE 1
519 #else
520 #undef CURL_LDAP_HYBRID
521 #undef HAVE_LDAP_URL_PARSE
522 #define CURL_LDAP_WIN 1
523 #endif
524
525 #if defined(__POCC__) && defined(CURL_LDAP_WIN)
526 #  define CURL_DISABLE_LDAP 1
527 #endif
528
529 /* ---------------------------------------------------------------- */
530 /*                       ADDITIONAL DEFINITIONS                     */
531 /* ---------------------------------------------------------------- */
532
533 /* Define cpu-machine-OS */
534 #undef OS
535 #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
536 #define OS "i386-pc-win32"
537 #elif defined(_M_IA64) /* Itanium */
538 #define OS "ia64-pc-win32"
539 #elif defined(_M_X64) /* AMD64/EM64T - Not defined until MSVC 2005 */
540 #define OS "amd64-pc-win32"
541 #else
542 #define OS "unknown-pc-win32"
543 #endif
544
545 /* Name of package */
546 #define PACKAGE "curl"
547
548 #if defined(__POCC__)
549 #  define ENABLE_IPV6 1
550 #endif
551
552 #endif /* __LIB_CONFIG_WIN32_H */