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.
23 * $Id: setup.h,v 1.59 2004/03/17 12:46:46 bagder Exp $
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 /* hand-modified win32 config.h! */
45 #include "config-win32.h"
50 /* hand-modified VMS config.h! */
51 #include "config-vms.h"
54 /* hand-modified NetWare config.h! */
55 #include "config-netware.h"
58 /* hand-modified MacOS config.h! */
59 #include "config-mac.h"
62 /* hand-modified AmigaOS config.h! */
73 #if !defined(__cplusplus) && !defined(__BEOS__)
74 typedef unsigned char bool;
79 #define LONG_LONG long long
83 #define LONG_LONG __int64
86 #endif /* HAVE_LONGLONG */
88 #ifndef SIZEOF_CURL_OFF_T
89 /* If we don't know the size here, we assume a conservative size: 4. When
90 building libcurl, the actual size of this variable should be define in the
92 #define SIZEOF_CURL_OFF_T 4
95 /* We set up our internal prefered (CURL_)FORMAT_OFF_T here */
96 #if SIZEOF_CURL_OFF_T > 4
97 #define FORMAT_OFF_T "lld"
99 #define FORMAT_OFF_T "ld"
102 #ifdef NEED_REENTRANT
103 /* Solaris machines needs _REENTRANT set for a few function prototypes and
104 things to appear in the #include files. We need to #define it before all
115 #ifdef __TANDEM /* for nsr-tandem-nsk systems */
119 #if defined(HAVE_X509_H) && defined(HAVE_SSL_H) && defined(HAVE_RSA_H) && \
120 defined(HAVE_PEM_H) && defined(HAVE_ERR_H) && defined(HAVE_CRYPTO_H) && \
121 defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO)
122 /* the six important includes files all exist and so do both libs,
123 defined SSLeay usage */
126 #if defined(HAVE_OPENSSL_X509_H) && defined(HAVE_OPENSSL_SSL_H) && \
127 defined(HAVE_OPENSSL_RSA_H) && defined(HAVE_OPENSSL_PEM_H) && \
128 defined(HAVE_OPENSSL_ERR_H) && defined(HAVE_OPENSSL_CRYPTO_H) && \
129 defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO)
130 /* the six important includes files all exist and so do both libs,
131 defined SSLeay usage */
133 #define USE_OPENSSL 1
136 #ifndef STDC_HEADERS /* no standard C headers! */
138 #include "../include/curl/stdcheaders.h"
140 #include <curl/stdcheaders.h>
144 #if defined(CURLDEBUG) && defined(HAVE_ASSERT_H)
146 #define curlassert(x) assert(x)
148 /* does nothing without CURLDEBUG defined */
149 #define curlassert(x)
153 /* If we have the MSG_NOSIGNAL define, we make sure to use that in the forth
154 argument to send() and recv() */
155 #define SEND_4TH_ARG MSG_NOSIGNAL
156 #define HAVE_MSG_NOSIGNAL 1 /* we have MSG_NOSIGNAL */
158 #define SEND_4TH_ARG 0
162 /* Below we define four functions. They should
164 2. read from a socket
167 4. set the SIGALRM signal timeout
168 5. set dir/file naming defines
173 #ifndef WIN32_LEAN_AND_MEAN
174 #define WIN32_LEAN_AND_MEAN /* Prevent including <winsock*.h> in <windows.h> */
177 #include <winsock2.h> /* required by telnet.c */
179 #if defined(ENABLE_IPV6) || defined(USE_SSLEAY)
180 #include <ws2tcpip.h>
183 #if !defined(__GNUC__) || defined(__MINGW32__)
184 #define sclose(x) closesocket(x)
185 #define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
186 #define swrite(x,y,z) (size_t)send(x,y,z, SEND_4TH_ARG)
189 /* gcc-for-win is still good :) */
190 #define sclose(x) close(x)
191 #define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
192 #define swrite(x,y,z) send(x,y,z, SEND_4TH_ARG)
196 #define DIR_CHAR "\\"
202 #define sclose(x) close_s(x)
203 #define sread(x,y,z) read_s(x,y,z)
204 #define swrite(x,y,z) write_s(x,y,z)
205 #define select(n,r,w,x,t) select_s(n,r,w,x,t)
206 #define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
216 #define sclose(x) closesocket(x)
217 #define sread(x,y,z) (ssize_t)recv(x,y,z, SEND_4TH_ARG)
218 #define swrite(x,y,z) (ssize_t)send(x,y,z, SEND_4TH_ARG)
220 #define sclose(x) close(x)
221 #define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
222 #define swrite(x,y,z) send(x,y,z, SEND_4TH_ARG)
232 #define sclose(x) CloseSocket(x)
243 #ifndef fileno /* sunos 4 have this as a macro! */
244 int fileno( FILE *stream);
249 /* now typedef our socket type */
251 typedef SOCKET curl_socket_t;
252 #define CURL_SOCKET_BAD INVALID_SOCKET
254 typedef int curl_socket_t;
255 #define CURL_SOCKET_BAD -1
258 #if defined(ENABLE_IPV6) && defined(USE_ARES)
259 #error "ares does not yet support IPv6. Disable IPv6 or ares and rebuild"
262 #if defined(WIN32) && !defined(__CYGWIN32__) && !defined(USE_ARES) && !defined(ENABLE_IPV6)
263 #define USE_THREADING_GETHOSTBYNAME /* Cygwin uses alarm() function */
267 * Curl_addrinfo MUST be used for name resolving information.
268 * Information regarding a single IP witin a Curl_addrinfo MUST be stored in
269 * a Curl_ipconnect struct.
272 typedef struct addrinfo Curl_addrinfo;
273 typedef struct addrinfo Curl_ipconnect;
275 typedef struct hostent Curl_addrinfo;
276 typedef struct in_addr Curl_ipconnect;
289 #define ECONNRESET WSAECONNRESET
291 /* This will effectively prevent the code from working in this particular
292 aspect, but it still compile fine! */
293 #define ECONNRESET 10000
301 #endif /* __CONFIG_H */