CURLOPT: bump CURLHEADER_* macros to long, drop casts

This patch bumps the size of these macros from `int` to `long`, while
keeping their actual values the same. It may cause incompatibilities in
user code, requiring the bump of holder variables and/or adding casts:

- CURLHEADER_SEPARATE
- CURLHEADER_UNIFIED

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18055
This commit is contained in:
Viktor Szakats 2025-07-28 11:10:34 +02:00
parent 1a12663d06
commit 113f6aacd4
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 6 additions and 6 deletions

View file

@ -1024,8 +1024,8 @@ typedef enum {
} curl_ftpmethod;
/* bitmask defines for CURLOPT_HEADEROPT */
#define CURLHEADER_UNIFIED 0
#define CURLHEADER_SEPARATE (1<<0)
#define CURLHEADER_UNIFIED 0L
#define CURLHEADER_SEPARATE (1L<<0)
/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
#define CURLALTSVC_READONLYFILE (1L<<2)

View file

@ -74,7 +74,7 @@ static CURLcode test_lib1525(char *URL)
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
test_setopt(curl, CURLOPT_HTTPHEADER, hhl);
test_setopt(curl, CURLOPT_PROXYHEADER, hhl);
test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_UNIFIED);
test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
test_setopt(curl, CURLOPT_POST, 0L);
test_setopt(curl, CURLOPT_UPLOAD, 1L);
test_setopt(curl, CURLOPT_VERBOSE, 1L);

View file

@ -78,7 +78,7 @@ static CURLcode test_lib1526(char *URL)
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
test_setopt(curl, CURLOPT_HTTPHEADER, hhl);
test_setopt(curl, CURLOPT_PROXYHEADER, phl);
test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_SEPARATE);
test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE);
test_setopt(curl, CURLOPT_POST, 0L);
test_setopt(curl, CURLOPT_UPLOAD, 1L);
test_setopt(curl, CURLOPT_VERBOSE, 1L);

View file

@ -85,7 +85,7 @@ static CURLcode test_lib1527(char *URL)
test_setopt(curl, CURLOPT_READFUNCTION, t1527_read_cb);
test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(t1527_testdata));
test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_UNIFIED);
test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
res = curl_easy_perform(curl);

View file

@ -56,7 +56,7 @@ static CURLcode test_lib1528(char *URL)
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
test_setopt(curl, CURLOPT_HTTPHEADER, hhl);
test_setopt(curl, CURLOPT_PROXYHEADER, phl);
test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_SEPARATE);
test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE);
test_setopt(curl, CURLOPT_VERBOSE, 1L);
test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
test_setopt(curl, CURLOPT_HEADER, 1L);