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)
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)
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
dnl Compilation based checks should not be done before this point.
dnl **********************************************************************
-CURL_CHECK_WIN32_LARGEFILE
CURL_CHECK_WIN32_CRYPTO
curl_cv_apple='no'
/* 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
/* 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
# endif
# include <sys/types.h>
# include <sys/stat.h>
-# 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 <unistd.h>
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);
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
target = fixed;
else
target = path;
-#ifndef USE_WIN32_LARGE_FILES
- result = _stat(target, buffer);
-#else
result = _stati64(target, buffer);
-#endif
#endif
CURLX_FREE(fixed);
#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
{
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