]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
msvc: require VS2005 for large file support
authorViktor Szakats <commit@vsz.me>
Thu, 9 Jan 2025 15:17:08 +0000 (16:17 +0100)
committerViktor Szakats <commit@vsz.me>
Sun, 12 Jan 2025 00:40:42 +0000 (01:40 +0100)
Large file support requires `_fseeki64()`. This function is offered in
VS2005 and upper.

VS2003 has it in the static CRT only, with declaration missing from
headers, so it's not usable.

Ref: https://archive.org/details/X10-38445 (MS Visual Studio .NET 2003)
Ref: 8b76a8aeb21c8ae2261147af1bddd0d4637c252c #15526

Closes #15958

CMakeLists.txt
lib/config-win32.h

index bd11cd61de308e88162cdf91414d485bdb1d46b6..65d76a975aa7a34b6145201964dec02afbb3f6ae 100644 (file)
@@ -1870,9 +1870,11 @@ include(CMake/OtherTests.cmake)
 
 add_definitions("-DHAVE_CONFIG_H")
 
-# For Windows, all compilers used by CMake should support large files
 if(WIN32)
-  set(USE_WIN32_LARGE_FILES ON)
+  # _fseeki64() requires VS2005
+  if(NOT MSVC OR (MSVC_VERSION GREATER_EQUAL 1400))
+    set(USE_WIN32_LARGE_FILES ON)
+  endif()
 
   # Use the manifest embedded in the Windows Resource
   set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -DCURL_EMBED_MANIFEST")
@@ -1898,7 +1900,7 @@ if(MSVC)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
   endif()
 
-  # Use multithreaded compilation on VS 2008+
+  # Use multithreaded compilation on VS2008+
   if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION GREATER_EQUAL 1500)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
   endif()
index 81dd46cf151e517f4f2cb7e1d36b0b4a4264b8d2..d0c551f1600c36237af63550c71c118726a1eeef 100644 (file)
@@ -387,7 +387,8 @@ Vista
 /*                        LARGE FILE SUPPORT                        */
 /* ---------------------------------------------------------------- */
 
-#if defined(_MSC_VER) || defined(__MINGW32__)
+/* _fseeki64() requires VS2005 */
+#if (defined(_MSC_VER) && (_MSC_VER >= 1400)) || defined(__MINGW32__)
 #  define USE_WIN32_LARGE_FILES
 /* Number of bits in a file offset, on hosts where this is settable. */
 #  ifdef __MINGW32__