From e5cf6223d79f8b7849c7b9b46227cca76bb4bdad Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 30 Jul 2025 23:54:47 +0200 Subject: [PATCH] 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 --- include/curl/curl.h | 8 ++++---- tests/libtest/lib1571.c | 2 +- tests/libtest/lib650.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/curl/curl.h b/include/curl/curl.h index 67f03503b7..36038494b3 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -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) diff --git a/tests/libtest/lib1571.c b/tests/libtest/lib1571.c index a4923e9196..622be2f643 100644 --- a/tests/libtest/lib1571.c +++ b/tests/libtest/lib1571.c @@ -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"); diff --git a/tests/libtest/lib650.c b/tests/libtest/lib650.c index 42fa5b822c..e758aabac0 100644 --- a/tests/libtest/lib650.c +++ b/tests/libtest/lib650.c @@ -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); -- 2.47.2