CURLOPT: bump CURL_REDIR_* macros to long

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:

- CURL_REDIR_GET_ALL
- CURL_REDIR_POST_301
- CURL_REDIR_POST_302
- CURL_REDIR_POST_303
- CURL_REDIR_POST_ALL

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

Closes #18110
This commit is contained in:
Viktor Szakats 2025-07-30 23:54:47 +02:00
parent 5f99b45693
commit e5cf6223d7
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
3 changed files with 6 additions and 6 deletions

View File

@ -2398,10 +2398,10 @@ enum CURL_TLSAUTH {
can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
| CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
#define CURL_REDIR_GET_ALL 0
#define CURL_REDIR_POST_301 1
#define CURL_REDIR_POST_302 2
#define CURL_REDIR_POST_303 4
#define CURL_REDIR_GET_ALL 0L
#define CURL_REDIR_POST_301 1L
#define CURL_REDIR_POST_302 2L
#define CURL_REDIR_POST_303 4L
#define CURL_REDIR_POST_ALL \
(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)

View File

@ -50,7 +50,7 @@ static CURLcode test_lib1571(const char *URL)
test_setopt(curl, CURLOPT_POSTFIELDS, "moo");
}
if(testnum == 1581) {
test_setopt(curl, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_301);
test_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_301);
}
test_setopt(curl, CURLOPT_CUSTOMREQUEST, "IGLOO");

View File

@ -187,7 +187,7 @@ static CURLcode test_lib650(const char *URL)
test_setopt(curl, CURLOPT_VERBOSE, 1L);
test_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
test_setopt(curl, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_301);
test_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_301);
/* include headers in the output */
test_setopt(curl, CURLOPT_HEADER, 1L);