File: libcurl-8.16-ftpmethod-type.patch

package info (click to toggle)
freefilesync 13.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,044 kB
  • sloc: cpp: 66,712; ansic: 447; makefile: 216
file content (42 lines) | stat: -rw-r--r-- 1,496 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From: Fab Stz <fabstz-it@yahoo.fr>
Date: Sat, 6 Sep 2025 10:33:06 +0200
Subject: Support curl's newftp methods type (since 8.16)

Last-Modified: 2025-09-06
Forwarded: not-needed
---
 FreeFileSync/Source/afs/ftp.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/FreeFileSync/Source/afs/ftp.cpp
+++ b/FreeFileSync/Source/afs/ftp.cpp
@@ -21,6 +21,11 @@
 using namespace fff;
 using AFS = AbstractFileSystem;
 
+#if LIBCURL_VERSION_NUM >= 0x081000 // 8.16.0
+#define CURL_FTPMETHOD_TYPE long
+#else
+#define CURL_FTPMETHOD_TYPE curl_ftpmethod
+#endif
 
 namespace
 {
@@ -316,7 +321,7 @@
     void setContextTimeout(const std::weak_ptr<int>& timeoutSec) { timeoutSec_ = timeoutSec; }
 
     //returns server response (header data)
-    std::string perform(const AfsPath& itemPath, bool isDir, curl_ftpmethod pathMethod,
+    std::string perform(const AfsPath& itemPath, bool isDir, CURL_FTPMETHOD_TYPE pathMethod,
                         const std::vector<CurlOption>& extraOptions, bool requestUtf8) //throw SysError, SysErrorPassword, SysErrorFtpProtocol
     {
         if (requestUtf8) //avoid endless recursion
@@ -1260,7 +1265,7 @@
                 {CURLOPT_WRITEDATA, &rawListing},
                 {CURLOPT_WRITEFUNCTION, onBytesReceived},
             };
-            curl_ftpmethod pathMethod = CURLFTPMETHOD_SINGLECWD;
+            CURL_FTPMETHOD_TYPE pathMethod = CURLFTPMETHOD_SINGLECWD;
 
             if (session.supportsMlsd()) //throw SysError
             {