3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at http://curl.haxx.se/docs/copyright.html.
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
24 ***************************************************************************/
27 #define CURL_DISABLE_FTP
28 #define CURL_DISABLE_LDAP
29 #define CURL_DISABLE_TELNET
30 #define CURL_DISABLE_DICT
31 #define CURL_DISABLE_FILE
32 #define CURL_DISABLE_GOPHER
35 #if !defined(WIN32) && defined(__WIN32__)
36 /* This should be a good Borland fix. Alexander J. Oss told us! */
41 #include "config.h" /* the configure script results */
44 #include "config-win32ce.h"
47 /* hand-modified win32 config.h! */
48 #include "config-win32.h"
54 /* hand-modified MacOS config.h! */
55 #include "config-mac.h"
58 /* hand-modified AmigaOS config.h! */
69 #if !defined(__cplusplus) && !defined(__BEOS__) && !defined(typedef_bool)
70 typedef unsigned char bool;
75 #define LONG_LONG long long
79 #define LONG_LONG __int64
82 #endif /* HAVE_LONGLONG */
84 #ifndef SIZEOF_CURL_OFF_T
85 /* If we don't know the size here, we assume a conservative size: 4. When
86 building libcurl, the actual size of this variable should be define in the
88 #define SIZEOF_CURL_OFF_T 4
91 /* We set up our internal prefered (CURL_)FORMAT_OFF_T here */
92 #if SIZEOF_CURL_OFF_T > 4
93 #define FORMAT_OFF_T "lld"
95 #define FORMAT_OFF_T "ld"
98 /*#ifdef NEED_REENTRANT*/
99 /* Solaris needs _REENTRANT set for a few function prototypes and things to
100 appear in the #include files. We need to #define it before all #include
101 files. Unixware needs it to build proper reentrant code. Others may also
112 #ifdef __TANDEM /* for nsr-tandem-nsk systems */
116 #ifndef STDC_HEADERS /* no standard C headers! */
117 #include <curl/stdcheaders.h>
120 #if defined(CURLDEBUG) && defined(HAVE_ASSERT_H)
121 #define curlassert(x) assert(x)
123 /* does nothing without CURLDEBUG defined */
124 #define curlassert(x)
128 /* If we have the MSG_NOSIGNAL define, we make sure to use that in the forth
129 argument to send() and recv() */
130 #define SEND_4TH_ARG MSG_NOSIGNAL
131 #define HAVE_MSG_NOSIGNAL 1 /* we have MSG_NOSIGNAL */
133 #define SEND_4TH_ARG 0
136 /* To make large file support transparent even on Windows */
137 #if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4)
138 #include <sys/stat.h> /* must come first before we redefine stat() */
140 #define lseek(x,y,z) _lseeki64(x, y, z)
141 #define struct_stat struct _stati64
142 #define stat(file,st) _stati64(file,st)
143 #define fstat(fd,st) _fstati64(fd,st)
145 #define struct_stat struct stat
148 /* Below we define four functions. They should
150 2. read from a socket
153 4. set the SIGALRM signal timeout
154 5. set dir/file naming defines
159 #ifndef WIN32_LEAN_AND_MEAN
160 #define WIN32_LEAN_AND_MEAN /* Prevent including <winsock*.h> in <windows.h> */
164 #include <winsock2.h> /* required by telnet.c */
167 #if defined(ENABLE_IPV6) || defined(USE_SSLEAY)
168 #include <ws2tcpip.h>
171 #if !defined(__GNUC__) || defined(__MINGW32__)
172 #define sclose(x) closesocket(x)
173 #define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
174 #define swrite(x,y,z) (size_t)send(x,y,z, SEND_4TH_ARG)
177 /* gcc-for-win is still good :) */
178 #define sclose(x) close(x)
179 #define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
180 #define swrite(x,y,z) send(x,y,z, SEND_4TH_ARG)
184 #define DIR_CHAR "\\"
190 #define sclose(x) close_s(x)
191 #define sread(x,y,z) read_s(x,y,z)
192 #define swrite(x,y,z) write_s(x,y,z)
193 #define select(n,r,w,x,t) select_s(n,r,w,x,t)
203 #define sclose(x) closesocket(x)
204 #define sread(x,y,z) (ssize_t)recv(x,y,z, SEND_4TH_ARG)
205 #define swrite(x,y,z) (ssize_t)send(x,y,z, SEND_4TH_ARG)
207 #define sclose(x) close(x)
208 #define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
209 #define swrite(x,y,z) send(x,y,z, SEND_4TH_ARG)
219 #define sclose(x) CloseSocket(x)
230 #ifndef fileno /* sunos 4 have this as a macro! */
231 int fileno( FILE *stream);
236 /* now typedef our socket type */
238 typedef SOCKET curl_socket_t;
239 #define CURL_SOCKET_BAD INVALID_SOCKET
241 typedef int curl_socket_t;
242 #define CURL_SOCKET_BAD -1
245 #if defined(ENABLE_IPV6) && defined(USE_ARES)
246 #error "ares does not yet support IPv6. Disable IPv6 or ares and rebuild"
249 #if defined(WIN32) && !defined(__CYGWIN__) && !defined(USE_ARES) && \
250 !defined(__LCC__) /* lcc-win32 doesn't have _beginthreadex() */
252 #define USE_THREADING_GETADDRINFO
254 #define USE_THREADING_GETHOSTBYNAME /* Cygwin uses alarm() function */
266 #if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H)
267 /* The lib was present and the tld.h header (which is missing in libidn 0.3.X
268 but we only work with libidn 0.4.1 or later) */
272 #ifndef SIZEOF_TIME_T
273 /* assume default size of time_t to be 32 bit */
274 #define SIZEOF_TIME_T 4
277 #define LIBIDN_REQUIRED_VERSION "0.4.1"
279 #endif /* __CONFIG_H */