6 /* Copyright (C) 2004 - 2007 by Daniel Stenberg et al
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.
20 * Define WIN32 when build target is Win32 API
23 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
28 * Include configuration script results or hand-crafted
29 * configuration file for platforms which lack config tool.
37 #include "config-win32.h"
40 #endif /* HAVE_CONFIG_H */
43 * Include header files for windows builds before redefining anything.
44 * Use this preproessor block only to include or exclude windows.h,
45 * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
46 * to any other further and independant block. Under Cygwin things work
47 * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
48 * never be included when __CYGWIN__ is defined. configure script takes
49 * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
50 * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
54 # ifndef WIN32_LEAN_AND_MEAN
55 # define WIN32_LEAN_AND_MEAN
58 # ifdef HAVE_WINSOCK2_H
59 # include <winsock2.h>
60 # ifdef HAVE_WS2TCPIP_H
61 # include <ws2tcpip.h>
64 # ifdef HAVE_WINSOCK_H
71 * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
72 * define USE_WINSOCK to 1 if we have and use WINSOCK API, else
73 * undefine USE_WINSOCK.
78 #ifdef HAVE_WINSOCK2_H
79 # define USE_WINSOCK 2
81 # ifdef HAVE_WINSOCK_H
82 # define USE_WINSOCK 1
87 * Work-arounds for systems without configure support
92 #if defined(__DJGPP__) || (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
98 #endif /* HAVE_CONFIG_H */
101 * Recent autoconf versions define these symbols in config.h. We don't
102 * want them (since they collide with the libcurl ones when we build
103 * --enable-debug) so we undef them again here.
106 #undef PACKAGE_STRING
107 #undef PACKAGE_TARNAME
108 #undef PACKAGE_VERSION
109 #undef PACKAGE_BUGREPORT
115 * Assume a few thing unless they're set by configure
118 #if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
119 #define HAVE_SYS_TIME_H
122 #if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
123 #define HAVE_UNISTD_H 1
126 #if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
127 #define HAVE_SYS_UIO_H
130 #if (defined(WIN32) || defined(WATT32)) && \
131 !(defined(__MINGW32__) || defined(NETWARE) || defined(__DJGPP__))
132 /* protos for the functions we provide in windows_port.c */
133 int ares_strncasecmp(const char *s1, const char *s2, int n);
134 int ares_strcasecmp(const char *s1, const char *s2);
136 /* use this define magic to prevent us from adding symbol names to the library
137 that is a high-risk to collide with another libraries' attempts to do the
139 #define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
140 #define strcasecmp(a,b) ares_strcasecmp(a,b)
142 # if _MSC_VER >= 1400
143 # define strdup(a) _strdup(a)
148 /* IPv6 compatibility */
149 #if !defined(HAVE_AF_INET6)
150 #if defined(HAVE_PF_INET6)
151 #define AF_INET6 PF_INET6
153 #define AF_INET6 AF_MAX+1
158 * Include macros and defines that should only be processed once.
161 #ifndef __SETUP_ONCE_H
162 #include "setup_once.h"
165 #endif /* __ARES_SETUP_H */