Adjustments to better select/differentiate when large/small file
support is provided using WIN32 functions directly.
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -10,6 +10,9 @@ Yang Tse (22 Aug 2008)
|
|||||||
- Improved libcurl's internal curl_m*printf() functions integral data type
|
- Improved libcurl's internal curl_m*printf() functions integral data type
|
||||||
size and signedness handling.
|
size and signedness handling.
|
||||||
|
|
||||||
|
- Internal adjustments to better select/differentiate when large/small file
|
||||||
|
support is provided using WIN32 functions directly.
|
||||||
|
|
||||||
Daniel Fandrich (20 Aug 2008)
|
Daniel Fandrich (20 Aug 2008)
|
||||||
- Added an edited version of Vincent Le Normand's documentation of SFTP quote
|
- Added an edited version of Vincent Le Normand's documentation of SFTP quote
|
||||||
commands to the man pages.
|
commands to the man pages.
|
||||||
|
|||||||
@@ -390,6 +390,22 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------- */
|
||||||
|
/* LARGE FILE SUPPORT */
|
||||||
|
/* ---------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
|
||||||
|
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||||
|
# define USE_WIN32_LARGE_FILES
|
||||||
|
# else
|
||||||
|
# define USE_WIN32_SMALL_FILES
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
|
||||||
|
# define USE_WIN32_SMALL_FILES
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
/* LDAP SUPPORT */
|
/* LDAP SUPPORT */
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
|
|||||||
@@ -340,6 +340,22 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------- */
|
||||||
|
/* LARGE FILE SUPPORT */
|
||||||
|
/* ---------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
|
||||||
|
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||||
|
# define USE_WIN32_LARGE_FILES
|
||||||
|
# else
|
||||||
|
# define USE_WIN32_SMALL_FILES
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
|
||||||
|
# define USE_WIN32_SMALL_FILES
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
/* LDAP SUPPORT */
|
/* LDAP SUPPORT */
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
|
|||||||
37
lib/setup.h
37
lib/setup.h
@@ -270,18 +270,33 @@
|
|||||||
#include <clib.h>
|
#include <clib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Large file (>2Gb) support using WIN32 functions.
|
||||||
|
*/
|
||||||
|
|
||||||
/* To make large file support transparent even on Windows */
|
#ifdef USE_WIN32_LARGE_FILES
|
||||||
#if defined(WIN32) && (CURL_SIZEOF_CURL_OFF_T > 4)
|
# include <io.h>
|
||||||
#include <sys/stat.h> /* must come first before we redefine stat() */
|
# include <sys/types.h>
|
||||||
#include <io.h>
|
# include <sys/stat.h>
|
||||||
#define lseek(x,y,z) _lseeki64(x, y, z)
|
# define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence)
|
||||||
#define struct_stat struct _stati64
|
# define fstat(fdes,stp) _fstati64(fdes, stp)
|
||||||
#define stat(file,st) _stati64(file,st)
|
# define stat(fname,stp) _stati64(fname, stp)
|
||||||
#define fstat(fd,st) _fstati64(fd,st)
|
# define struct_stat struct _stati64
|
||||||
#else
|
#endif
|
||||||
#define struct_stat struct stat
|
|
||||||
#endif /* Win32 with large file support */
|
/*
|
||||||
|
* 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
|
/* Below we define some functions. They should
|
||||||
|
|||||||
@@ -235,6 +235,22 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------- */
|
||||||
|
/* LARGE FILE SUPPORT */
|
||||||
|
/* ---------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
|
||||||
|
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||||
|
# define USE_WIN32_LARGE_FILES
|
||||||
|
# else
|
||||||
|
# define USE_WIN32_SMALL_FILES
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
|
||||||
|
# define USE_WIN32_SMALL_FILES
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
/* ADDITIONAL DEFINITIONS */
|
/* ADDITIONAL DEFINITIONS */
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
|
|||||||
32
src/main.c
32
src/main.c
@@ -210,14 +210,32 @@ typedef enum {
|
|||||||
#include "curlmsg_vms.h"
|
#include "curlmsg_vms.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Support uploading and resuming of >2GB files
|
/*
|
||||||
|
* Large file support (>2Gb) using WIN32 functions.
|
||||||
*/
|
*/
|
||||||
#if defined(WIN32) && (CURL_SIZEOF_CURL_OFF_T > 4)
|
|
||||||
#define lseek(x,y,z) _lseeki64(x, y, z)
|
#ifdef USE_WIN32_LARGE_FILES
|
||||||
#define struct_stat struct _stati64
|
# include <io.h>
|
||||||
#define stat(file,st) _stati64(file,st)
|
# include <sys/types.h>
|
||||||
#else
|
# include <sys/stat.h>
|
||||||
#define struct_stat struct stat
|
# 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 support (<2Gb) 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
|
#endif
|
||||||
|
|
||||||
#ifdef CURL_DOES_CONVERSIONS
|
#ifdef CURL_DOES_CONVERSIONS
|
||||||
|
|||||||
Reference in New Issue
Block a user