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.164 2009-05-01 12:39:40 yangtse 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
73
#include "config-os400.h"
74
#include "setup-os400.h"
64
# include "config-os400.h"
78
#include "config-tpf.h" /* hand-modified TPF config.h */
79
/* change which select is used for libcurl */
80
#define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e)
68
# include "config-tpf.h"
83
71
#endif /* HAVE_CONFIG_H */
73
/* ================================================================ */
74
/* Definition of preprocessor macros/symbols which modify compiler */
75
/* behaviour or generated code characteristics must be done here, */
76
/* as appropriate, before any system header file is included. It is */
77
/* also possible to have them defined in the config file included */
78
/* before this point. As a result of all this we frown inclusion of */
79
/* system header files in our config files, avoid this at any cost. */
80
/* ================================================================ */
83
* Tru64 needs _REENTRANT set for a few function prototypes and
84
* things to appear in the system header files. Unixware needs it
85
* to build proper reentrant code. Others may also need it.
94
/* ================================================================ */
95
/* If you need to include a system header file for your platform, */
96
/* please, do it beyond the point further indicated in this file. */
97
/* ================================================================ */
100
* libcurl's external interface definitions are also used internally,
101
* and might also include required system header files to define them.
104
#include <curl/curlbuild.h>
107
* Compile time sanity checks must also be done when building the library.
110
#include <curl/curlrules.h>
113
* Ensure that no one is using the old SIZEOF_CURL_OFF_T macro
116
#ifdef SIZEOF_CURL_OFF_T
117
# error "SIZEOF_CURL_OFF_T shall not be defined!"
118
Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined
122
* Set up internal curl_off_t formatting string directives for
123
* exclusive use with libcurl's internal *printf functions.
127
# error "FORMAT_OFF_T shall not be defined before this point!"
128
Error Compilation_aborted_FORMAT_OFF_T_already_defined
132
# error "FORMAT_OFF_TU shall not be defined before this point!"
133
Error Compilation_aborted_FORMAT_OFF_TU_already_defined
136
#if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG)
137
# define FORMAT_OFF_T "lld"
138
# define FORMAT_OFF_TU "llu"
140
# define FORMAT_OFF_T "ld"
141
# define FORMAT_OFF_TU "lu"
145
* Disable other protocols when http is the only one desired.
149
# define CURL_DISABLE_TFTP
150
# define CURL_DISABLE_FTP
151
# define CURL_DISABLE_LDAP
152
# define CURL_DISABLE_TELNET
153
# define CURL_DISABLE_DICT
154
# define CURL_DISABLE_FILE
157
/* ================================================================ */
158
/* No system header file shall be included in this file before this */
159
/* point. The only allowed ones are those included from curlbuild.h */
160
/* ================================================================ */
163
* OS/400 setup file includes some system headers.
167
# include "setup-os400.h"
86
171
* Include header files for windows builds before redefining anything.
87
172
* 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
214
#ifdef HAVE_EXTRA_STRICMP_H
215
# include <extra/stricmp.h>
218
#ifdef HAVE_EXTRA_STRDUP_H
219
# include <extra/strdup.h>
223
# include <strings.h> /* for bzero, strcasecmp, and strncasecmp */
224
# include <string.h> /* for strcpy and strlen */
225
# include <stdlib.h> /* for rand and srand */
226
# include <sys/socket.h> /* for select and ioctl*/
227
# include <netdb.h> /* for in_addr_t definition */
228
# include <tpf/sysapi.h> /* for tpf_process_signals */
229
/* change which select is used for libcurl */
230
# define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e)
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 */