diff options
author | Yang Tse <yangsita@gmail.com> | 2008-08-22 18:09:03 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-08-22 18:09:03 +0000 |
commit | 9849c6b8479f18d983eadd58d7ba6f9feaaa8f6a (patch) | |
tree | 975fea4964c402e7ff3ec78177e4520d773a987e /lib/setup.h | |
parent | 9bb5da968c7ab38434d426f9928bcd69cf4ebb02 (diff) |
Adjustments to better select/differentiate when large/small file
support is provided using WIN32 functions directly.
Diffstat (limited to 'lib/setup.h')
-rw-r--r-- | lib/setup.h | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/lib/setup.h b/lib/setup.h index 4354f7fa8..2de894cef 100644 --- a/lib/setup.h +++ b/lib/setup.h @@ -270,18 +270,33 @@ #include <clib.h> #endif +/* + * Large file (>2Gb) support using WIN32 functions. + */ -/* To make large file support transparent even on Windows */ -#if defined(WIN32) && (CURL_SIZEOF_CURL_OFF_T > 4) -#include <sys/stat.h> /* must come first before we redefine stat() */ -#include <io.h> -#define lseek(x,y,z) _lseeki64(x, y, z) -#define struct_stat struct _stati64 -#define stat(file,st) _stati64(file,st) -#define fstat(fd,st) _fstati64(fd,st) -#else -#define struct_stat struct stat -#endif /* Win32 with large file support */ +#ifdef USE_WIN32_LARGE_FILES +# include <io.h> +# include <sys/types.h> +# include <sys/stat.h> +# define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence) +# define fstat(fdes,stp) _fstati64(fdes, stp) +# define stat(fname,stp) _stati64(fname, stp) +# define struct_stat struct _stati64 +#endif + +/* + * Small file (<2Gb) support using WIN32 functions. + */ + +#ifdef USE_WIN32_SMALL_FILES +# include <io.h> +# include <sys/types.h> +# include <sys/stat.h> +# define lseek(fdes,offset,whence) _lseek(fdes, offset, whence) +# define fstat(fdes,stp) _fstat(fdes, stp) +# define stat(fname,stp) _stat(fname, stp) +# define struct_stat struct _stat +#endif /* Below we define some functions. They should |