diff --git a/CMakeLists.txt b/CMakeLists.txt index 685335667b..8b3cbecc51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1772,8 +1772,6 @@ if(WIN32) endif() list(APPEND CURL_LIBS "bcrypt") - set(USE_WIN32_LARGE_FILES ON) - # We use crypto functions that are not available for UWP apps if(NOT WINDOWS_STORE) set(USE_WIN32_CRYPTO ON) @@ -1972,8 +1970,7 @@ curl_add_if("asyn-rr" USE_ARES AND ENABLE_THREADED_RESOLVER AND USE_HTTPSR curl_add_if("IDN" (HAVE_LIBIDN2 AND HAVE_IDN2_H) OR USE_WIN32_IDN OR USE_APPLE_IDN) -curl_add_if("Largefile" (SIZEOF_CURL_OFF_T GREATER 4) AND - ((SIZEOF_OFF_T GREATER 4) OR USE_WIN32_LARGE_FILES)) +curl_add_if("Largefile" (SIZEOF_CURL_OFF_T GREATER 4) AND ((SIZEOF_OFF_T GREATER 4) OR WIN32)) curl_add_if("SSPI" USE_WINDOWS_SSPI) curl_add_if("GSS-API" HAVE_GSSAPI) curl_add_if("alt-svc" NOT CURL_DISABLE_ALTSVC) diff --git a/acinclude.m4 b/acinclude.m4 index 60e05add11..0627ed1fd7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1307,33 +1307,6 @@ AS_HELP_STRING([--without-ca-embed], [Do not embed a default CA bundle in the cu fi ]) -dnl CURL_CHECK_WIN32_LARGEFILE -dnl ------------------------------------------------- -dnl Check if curl's Win32 large file will be used - -AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ - AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl - if test "$curl_cv_native_windows" = 'yes'; then - AC_MSG_CHECKING([whether build target supports Win32 large files]) - dnl All mingw-w64 versions support large files - curl_win32_has_largefile='yes' - case "$curl_win32_has_largefile" in - yes) - if test x"$enable_largefile" = 'xno'; then - AC_MSG_RESULT([yes (large file disabled)]) - else - AC_MSG_RESULT([yes (large file enabled)]) - AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1, - [Define to 1 if you are building a Windows target with large file support.]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac - fi -]) - dnl CURL_CHECK_WIN32_CRYPTO dnl ------------------------------------------------- dnl Check if curl's Win32 crypto lib can be used diff --git a/configure.ac b/configure.ac index f0d05b1827..64fa6516ec 100644 --- a/configure.ac +++ b/configure.ac @@ -618,7 +618,6 @@ dnl ********************************************************************** dnl Compilation based checks should not be done before this point. dnl ********************************************************************** -CURL_CHECK_WIN32_LARGEFILE CURL_CHECK_WIN32_CRYPTO curl_cv_apple='no' diff --git a/lib/config-win32.h b/lib/config-win32.h index 4b9ba3e32c..2bdb555084 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -318,19 +318,14 @@ /* LARGE FILE SUPPORT */ /* ---------------------------------------------------------------- */ -#if defined(_MSC_VER) || defined(__MINGW32__) -# define USE_WIN32_LARGE_FILES /* Number of bits in a file offset, on hosts where this is settable. */ -# ifdef __MINGW32__ -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif -# endif +#ifdef __MINGW32__ +# undef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 #endif /* Define to the size of `off_t', as computed by sizeof. */ -#if defined(__MINGW32__) && \ - defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) +#ifdef __MINGW32__ # define SIZEOF_OFF_T 8 #else # define SIZEOF_OFF_T 4 diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index 37ec3d9a65..eaac11ec00 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -761,9 +761,6 @@ ${SIZEOF_TIME_T_CODE} /* if Unix domain sockets are enabled */ #cmakedefine USE_UNIX_SOCKETS 1 -/* Define to 1 if you are building a Windows target with large file support. */ -#cmakedefine USE_WIN32_LARGE_FILES 1 - /* to enable SSPI support */ #cmakedefine USE_WINDOWS_SSPI 1 diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 829650aee4..a7dc41493c 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -471,22 +471,13 @@ # endif # include # include -# ifdef USE_WIN32_LARGE_FILES - /* Large file (>2Gb) support using Win32 functions. */ -# undef lseek -# define lseek(fdes, offset, whence) _lseeki64(fdes, offset, whence) -# undef fstat -# define fstat(fdes, stp) _fstati64(fdes, stp) -# define struct_stat struct _stati64 -# define LSEEK_ERROR (__int64)-1 -# else - /* Small file (<2Gb) support using Win32 functions. */ -# undef lseek -# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence) -# define fstat(fdes, stp) _fstat(fdes, stp) -# define struct_stat struct _stat -# define LSEEK_ERROR (long)-1 -# endif + /* Large file (>2Gb) support using Win32 functions. */ +# undef lseek +# define lseek(fdes, offset, whence) _lseeki64(fdes, offset, whence) +# undef fstat +# define fstat(fdes, stp) _fstati64(fdes, stp) +# define struct_stat struct _stati64 +# define LSEEK_ERROR (__int64)-1 #elif defined(__DJGPP__) /* Requires DJGPP 2.04 */ # include diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index c9b7a9c0b5..75ff63901e 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -28,7 +28,7 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence) { -#if defined(_WIN32) && defined(USE_WIN32_LARGE_FILES) +#ifdef _WIN32 return _fseeki64(stream, (__int64)offset, whence); #elif defined(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO) return fseeko(stream, (off_t)offset, whence); @@ -373,11 +373,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) target = fixed; else target = path_w; -#ifndef USE_WIN32_LARGE_FILES - result = _wstat(target, buffer); -#else result = _wstati64(target, buffer); -#endif CURLX_FREE(path_w); } else @@ -388,11 +384,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) target = fixed; else target = path; -#ifndef USE_WIN32_LARGE_FILES - result = _stat(target, buffer); -#else result = _stati64(target, buffer); -#endif #endif CURLX_FREE(fixed); diff --git a/lib/version.c b/lib/version.c index 79654fa975..fe4f637d67 100644 --- a/lib/version.c +++ b/lib/version.c @@ -500,8 +500,7 @@ static const struct feat features_table[] = { #ifdef USE_KERBEROS5 FEATURE("Kerberos", NULL, CURL_VERSION_KERBEROS5), #endif -#if (SIZEOF_CURL_OFF_T > 4) && \ - ( (SIZEOF_OFF_T > 4) || defined(USE_WIN32_LARGE_FILES) ) +#if (SIZEOF_CURL_OFF_T > 4) && ((SIZEOF_OFF_T > 4) || defined(_WIN32)) FEATURE("Largefile", NULL, CURL_VERSION_LARGEFILE), #endif #ifdef HAVE_LIBZ diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c index ea5c8e313b..6c3cadc7f5 100644 --- a/src/tool_cb_see.c +++ b/src/tool_cb_see.c @@ -38,7 +38,7 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) { struct per_transfer *per = userdata; -#if (SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(USE_WIN32_LARGE_FILES) +#if (SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(_WIN32) /* OUR_MAX_SEEK_L has 'long' data type, OUR_MAX_SEEK_O has 'curl_off_t, both represent the same value. Maximum offset used here when we lseek