curl.h: change some enums to defines with L suffix

To help applications do the right thing easier, change some enum values
into defines with L suffixes so that they get the corect type (long)
easier when used with curl_easy_setopt(). This also fixes a few of our
own libtests.

To reduce the risk that this change breaks the compile for any existing
users, the previously provided enums are still provided, but the values
to use are not defined by the enums.

This change "magically" fixes a few RTSP test failures we have had on
64-bit platforms because those options were not see using longs
properly.

Closes #16482
This commit is contained in:
Daniel Stenberg 2025-02-25 17:33:17 +01:00
parent 7826927d9b
commit 2ec00372a1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 42 additions and 36 deletions

View file

@ -200,7 +200,7 @@ struct OperationConfig {
long expect100timeout_ms;
long happy_eyeballs_timeout_ms; /* happy eyeballs timeout in milliseconds.
0 is valid. default: CURL_HET_DEFAULT. */
curl_TimeCond timecond;
unsigned long timecond;
HttpReq httpreq;
int proxyver; /* set to CURLPROXY_HTTP* define */
int ftp_ssl_ccc_mode;

View file

@ -1397,7 +1397,7 @@ static CURLcode config2setopts(struct GlobalConfig *global,
my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession ?
1L : 0L);
my_setopt_enum(curl, CURLOPT_TIMECONDITION, (long)config->timecond);
my_setopt_enum(curl, CURLOPT_TIMECONDITION, config->timecond);
my_setopt(curl, CURLOPT_TIMEVALUE_LARGE, config->condtime);
my_setopt_str(curl, CURLOPT_CUSTOMREQUEST, config->customrequest);
customrequest_helper(config, config->httpreq, config->customrequest);