]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: use `_fseeki64()` on Windows, drop detections
authorViktor Szakats <commit@vsz.me>
Fri, 8 Nov 2024 17:51:45 +0000 (18:51 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 11 Nov 2024 13:25:04 +0000 (14:25 +0100)
A recent update caused CMake builds to mis-detect this symbol on iOS.
Auto-detection also seems redundant given that it's a Windows-only
function and most Windows builds were already opted-in.

Drop detections and use it in all Windows builds with large file support
enabled.

Feature history:
- pririotizing for Windows: aaacd02466f77d03b8fdc19e91a0a3ec72f4c38a #14678
- Windows opt-in cmake: 8e74c0729d0cace00a202fc6c33c1b35703e220a #11950
- Windows opt-in: aa6c94c5bf4f5caa31c0213d9cd7058c29a9b30b #11944
- use in libcurl: 9c7165e96a3a9a2d0b7059c87c699b5ca8cdae93 #11918
- use in example: 817d1c01064ac81e9609819b15738ee540ef056c

Regression from 8e345057761a8f796403923a96f2c8fd3edca647 #15164

Reported-by: Maarten Billemont
Fixes #15525
Closes #15526

CMake/Platforms/WindowsCache.cmake
CMakeLists.txt
configure.ac
lib/config-win32.h
lib/curl_config.h.cmake
lib/formdata.c

index 0997ef3e15714ff1f4b8174e4f0e4d0388226918..077bed228e95e3fcbfbfece5abf6005492b98972 100644 (file)
@@ -148,7 +148,6 @@ set(HAVE_TERMIO_H 0)
 set(HAVE_LINUX_TCP_H 0)
 
 set(HAVE_FSEEKO 0)  # mingw-w64 2.0.0 and newer has it
-set(HAVE__FSEEKI64 1)
 set(HAVE_SOCKET 1)
 set(HAVE_SELECT 1)
 set(HAVE_STRDUP 1)
index 4dbd2df2ad57512056841cfdbec3fda19f4c01fa..b8b80dc7c6a826dbc8a6adb70b6a9de5924055ce 100644 (file)
@@ -1570,7 +1570,6 @@ check_symbol_exists("freeaddrinfo"    "${CURL_INCLUDES}" HAVE_FREEADDRINFO)  # w
 check_function_exists("pipe"          HAVE_PIPE)
 check_function_exists("eventfd"       HAVE_EVENTFD)
 check_symbol_exists("ftruncate"       "unistd.h" HAVE_FTRUNCATE)
-check_function_exists("_fseeki64"     HAVE__FSEEKI64)
 check_symbol_exists("getpeername"     "${CURL_INCLUDES}" HAVE_GETPEERNAME)  # winsock2.h unistd.h proto/bsdsocket.h
 check_symbol_exists("getsockname"     "${CURL_INCLUDES}" HAVE_GETSOCKNAME)  # winsock2.h unistd.h proto/bsdsocket.h
 check_function_exists("if_nametoindex"  HAVE_IF_NAMETOINDEX)  # winsock2.h net/if.h
index a8bd87e736fae7d95faa48d90910c940df8057c1..99ce9a4ff645fe73e6a4b21e24328eb4b14b6f9a 100644 (file)
@@ -4100,7 +4100,6 @@ AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Se
           #include <sys/types.h>]])
 
 AC_CHECK_FUNCS([\
-  _fseeki64 \
   eventfd \
   fnmatch \
   geteuid \
index e6abf062151a7ae657812479d2677f67cd97ee2c..2daed912d0e9bd9ed4437c20df8a0deee5a5bc65 100644 (file)
@@ -427,10 +427,6 @@ Vista
 #  endif
 #endif
 
-#ifdef USE_WIN32_LARGE_FILES
-#define HAVE__FSEEKI64
-#endif
-
 /* Define to the size of `off_t', as computed by sizeof. */
 #if defined(__MINGW32__) && \
   defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
index 7ee0a400f7fc144a61a33c8ae5be9035ccd1bd4f..1ac59ff057fd220c610b060854578f5b66fcf629 100644 (file)
 /* Define to 1 if you have the fseeko declaration. */
 #cmakedefine HAVE_DECL_FSEEKO 1
 
-/* Define to 1 if you have the _fseeki64 function. */
-#cmakedefine HAVE__FSEEKI64 1
-
 /* Define to 1 if you have the ftruncate function. */
 #cmakedefine HAVE_FTRUNCATE 1
 
index cea61b22e1747e98ee6edd5a69b3695f4ffe7b37..7ea7a8f396b48aceb20af861d74e083e86b0009e 100644 (file)
@@ -793,7 +793,7 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len)
 /* wrap call to fseeko so it matches the calling convention of callback */
 static int fseeko_wrapper(void *stream, curl_off_t offset, int whence)
 {
-#if defined(HAVE__FSEEKI64)
+#if defined(_WIN32) && defined(USE_WIN32_LARGE_FILES)
   return _fseeki64(stream, (__int64)offset, whence);
 #elif defined(HAVE_FSEEKO) && defined(HAVE_DECL_FSEEKO)
   return fseeko(stream, (off_t)offset, whence);