diff --git a/lib/file.c b/lib/file.c index 6b2bbd161c0ce7f5b70ba1fe16e7ab4102a30424..267a99ba0935b878d1d186c0e348388451e4f62e 100644 --- a/lib/file.c +++ b/lib/file.c @@ -167,14 +167,6 @@ CURLcode Curl_file_connect(struct connectdata *conn) return CURLE_OK; } -#if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4) -#define lseek(x,y,z) _lseeki64(x, y, z) -#define struct_stat struct _stati64 -#define fstat(fd,st) _fstati64(fd,st) -#else -#define struct_stat struct stat -#endif - CURLcode Curl_file_done(struct connectdata *conn, CURLcode status) { diff --git a/lib/formdata.c b/lib/formdata.c index 07e5a0ddfdaacef74cf967ed0702c5226c841a91..4f0845c3fb7ed8f6a783544d4331ec6e7e05d1bb 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -835,7 +835,7 @@ static CURLcode AddFormData(struct FormData **formp, /* Since this is a file to be uploaded here, add the size of the actual file */ if(!strequal("-", newform->line)) { - struct stat file; + struct_stat file; if(!stat(newform->line, &file)) { *size += file.st_size; } diff --git a/lib/setup.h b/lib/setup.h index b893417a4bcba2d774f541476d40893e07f50e50..b02469976d7ae6fee2fe4d029595fee4ecaeb162 100644 --- a/lib/setup.h +++ b/lib/setup.h @@ -133,6 +133,14 @@ typedef unsigned char bool; #define SEND_4TH_ARG 0 #endif +/* To make large file support transparent even on Windows */ +#if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4) +#define lseek(x,y,z) _lseeki64(x, y, z) +#define struct_stat struct _stati64 +#define fstat(fd,st) _fstati64(fd,st) +#else +#define struct_stat struct stat +#endif /* Below we define four functions. They should 1. close a socket