7
7
* | (__| |_| | _ <| |___
8
8
* \___|\___/|_| \_\_____|
10
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
10
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
12
12
* This software is licensed as described in the file COPYING, which
13
13
* you should have received as part of this distribution. The terms
20
20
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
21
* KIND, either express or implied.
23
* $Id: setup.h,v 1.137 2008-04-22 22:53:54 danf Exp $
23
* $Id: setup.h,v 1.163 2009-02-12 20:48:44 danf Exp $
24
24
***************************************************************************/
27
#define CURL_DISABLE_TFTP
28
#define CURL_DISABLE_FTP
29
#define CURL_DISABLE_LDAP
30
#define CURL_DISABLE_TELNET
31
#define CURL_DISABLE_DICT
32
#define CURL_DISABLE_FILE
33
#endif /* HTTP_ONLY */
36
27
* Define WIN32 when build target is Win32 API
83
73
#endif /* HAVE_CONFIG_H */
75
/* ================================================================ */
76
/* Definition of preprocessor macros/symbols which modify compiler */
77
/* behaviour or generated code characteristics must be done here, */
78
/* as appropriate, before any system header file is included. It is */
79
/* also possible to have them defined in the config file included */
80
/* before this point. As a result of all this we frown inclusion of */
81
/* system header files in our config files, avoid this at any cost. */
82
/* ================================================================ */
85
* Tru64 needs _REENTRANT set for a few function prototypes and
86
* things to appear in the system header files. Unixware needs it
87
* to build proper reentrant code. Others may also need it.
96
/* ================================================================ */
97
/* If you need to include a system header file for your platform, */
98
/* please, do it beyond the point further indicated in this file. */
99
/* ================================================================ */
102
* libcurl's external interface definitions are also used internally,
103
* and might also include required system header files to define them.
106
#include <curl/curlbuild.h>
109
* Compile time sanity checks must also be done when building the library.
112
#include <curl/curlrules.h>
115
* Ensure that no one is using the old SIZEOF_CURL_OFF_T macro
118
#ifdef SIZEOF_CURL_OFF_T
119
# error "SIZEOF_CURL_OFF_T shall not be defined!"
120
Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined
124
* Set up internal curl_off_t formatting string directives for
125
* exclusive use with libcurl's internal *printf functions.
129
# error "FORMAT_OFF_T shall not be defined before this point!"
130
Error Compilation_aborted_FORMAT_OFF_T_already_defined
134
# error "FORMAT_OFF_TU shall not be defined before this point!"
135
Error Compilation_aborted_FORMAT_OFF_TU_already_defined
138
#if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG)
139
# define FORMAT_OFF_T "lld"
140
# define FORMAT_OFF_TU "llu"
142
# define FORMAT_OFF_T "ld"
143
# define FORMAT_OFF_TU "lu"
147
* Disable other protocols when http is the only one desired.
151
# define CURL_DISABLE_TFTP
152
# define CURL_DISABLE_FTP
153
# define CURL_DISABLE_LDAP
154
# define CURL_DISABLE_TELNET
155
# define CURL_DISABLE_DICT
156
# define CURL_DISABLE_FILE
159
/* ================================================================ */
160
/* No system header file shall be included in this file before this */
161
/* point. The only allowed ones are those included from curlbuild.h */
162
/* ================================================================ */
165
* OS/400 setup file includes some system headers.
169
# include "setup-os400.h"
86
173
* Include header files for windows builds before redefining anything.
87
174
* Use this preproessor block only to include or exclude windows.h,
131
#define LONG_LONG long long
135
#define LONG_LONG __int64
137
#endif /* _MSC_VER */
138
#endif /* HAVE_LONGLONG */
140
#ifndef SIZEOF_CURL_OFF_T
141
/* If we don't know the size here, we assume a conservative size: 4. When
142
building libcurl, the actual size of this variable should be define in the
144
#define SIZEOF_CURL_OFF_T 4
147
/* We set up our internal prefered (CURL_)FORMAT_OFF_T here */
148
#if SIZEOF_CURL_OFF_T > 4
149
#define FORMAT_OFF_T "lld"
151
#define FORMAT_OFF_T "ld"
152
#endif /* SIZEOF_CURL_OFF_T */
155
/* Solaris needs _REENTRANT set for a few function prototypes and things to
156
appear in the #include files. We need to #define it before all #include
157
files. Unixware needs it to build proper reentrant code. Others may also
216
#ifdef HAVE_EXTRA_STRICMP_H
217
# include <extra/stricmp.h>
220
#ifdef HAVE_EXTRA_STRDUP_H
221
# include <extra/strdup.h>
225
# include <strings.h> /* for bzero, strcasecmp, and strncasecmp */
226
# include <string.h> /* for strcpy and strlen */
227
# include <stdlib.h> /* for rand and srand */
228
# include <sys/socket.h> /* for select and ioctl*/
229
# include <netdb.h> /* for in_addr_t definition */
230
# include <tpf/sysapi.h> /* for tpf_process_signals */
162
233
#include <stdio.h>
199
270
#include <clib.h>
203
/* To make large file support transparent even on Windows */
204
#if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4)
205
#include <sys/stat.h> /* must come first before we redefine stat() */
207
#define lseek(x,y,z) _lseeki64(x, y, z)
208
#define struct_stat struct _stati64
209
#define stat(file,st) _stati64(file,st)
210
#define fstat(fd,st) _fstati64(fd,st)
212
#define struct_stat struct stat
213
#endif /* Win32 with large file support */
274
* Large file (>2Gb) support using WIN32 functions.
277
#ifdef USE_WIN32_LARGE_FILES
279
# include <sys/types.h>
280
# include <sys/stat.h>
281
# define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence)
282
# define fstat(fdes,stp) _fstati64(fdes, stp)
283
# define stat(fname,stp) _stati64(fname, stp)
284
# define struct_stat struct _stati64
288
* Small file (<2Gb) support using WIN32 functions.
291
#ifdef USE_WIN32_SMALL_FILES
293
# include <sys/types.h>
294
# include <sys/stat.h>
295
# define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence)
296
# define fstat(fdes,stp) _fstat(fdes, stp)
297
# define stat(fname,stp) _stat(fname, stp)
298
# define struct_stat struct _stat
302
# define struct_stat struct stat
306
* Default sizeof(off_t) in case it hasn't been defined in config file.
310
# if defined(__VMS) && (defined(__alpha) || defined(__ia64))
311
# if defined(_LARGEFILE)
312
# define SIZEOF_OFF_T 8
314
# elif defined(__OS400__) && defined(__ILEC400__)
315
# if defined(_LARGE_FILES)
316
# define SIZEOF_OFF_T 8
318
# elif defined(__MVS__) && defined(__IBMC__)
319
# if defined(_LP64) || defined(_LARGE_FILES)
320
# define SIZEOF_OFF_T 8
322
# elif defined(__370__) && defined(__IBMC__)
323
# if defined(_LP64) || defined(_LARGE_FILES)
324
# define SIZEOF_OFF_T 8
327
# ifndef SIZEOF_OFF_T
328
# define SIZEOF_OFF_T 4
216
332
/* Below we define some functions. They should
217
333
1. close a socket
225
#if !defined(__CYGWIN__)
226
#define sclose(x) closesocket(x)
230
/* gcc-for-win is still good :) */
231
#define sclose(x) close(x)
233
#endif /* !GNU or mingw */
235
#define DIR_CHAR "\\"
341
# if !defined(__CYGWIN__)
342
# define sclose(x) closesocket(x)
344
# define sclose(x) close(x)
347
# define DIR_CHAR "\\"
348
# define DOT_CHAR "_"
238
350
#else /* WIN32 */
240
#ifdef MSDOS /* Watt-32 */
241
#include <sys/ioctl.h>
242
#define sclose(x) close_s(x)
243
#define select(n,r,w,x,t) select_s(n,r,w,x,t)
244
#define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
254
#define sclose(x) closesocket(x)
256
#define sclose(x) close(x)
257
#endif /* __BEOS__ */
266
#define sclose(x) CloseSocket(x)
270
/* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
271
extern char * strtok_r(char *s, const char *delim, char **last);
272
extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp);
289
#ifndef fileno /* sunos 4 have this as a macro! */
290
int fileno( FILE *stream);
352
# ifdef MSDOS /* Watt-32 */
354
# include <sys/ioctl.h>
355
# define sclose(x) close_s(x)
356
# define select(n,r,w,x,t) select_s(n,r,w,x,t)
357
# define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
369
# define sclose(x) closesocket(x)
370
# else /* __BEOS__ */
371
# define sclose(x) close(x)
372
# endif /* __BEOS__ */
378
# define sclose(x) CloseSocket(x)
382
/* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
383
extern char * strtok_r(char *s, const char *delim, char **last);
384
extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp);
387
# define DIR_CHAR "/"
389
# define DOT_CHAR "."
394
# define DOT_CHAR "_"
397
# ifndef fileno /* sunos 4 have this as a macro! */
398
int fileno( FILE *stream);
293
401
#endif /* WIN32 */