CURLOPT: bump CURLPROTO_* 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:

- CURLPROTO_HTTP
- CURLPROTO_HTTPS
- CURLPROTO_FTP
- CURLPROTO_FTPS
- CURLPROTO_SCP
- CURLPROTO_SFTP
- CURLPROTO_TELNET
- CURLPROTO_LDAP
- CURLPROTO_LDAPS
- CURLPROTO_DICT
- CURLPROTO_FILE
- CURLPROTO_TFTP
- CURLPROTO_IMAP
- CURLPROTO_IMAPS
- CURLPROTO_POP3
- CURLPROTO_POP3S
- CURLPROTO_SMTP
- CURLPROTO_SMTPS
- CURLPROTO_RTSP
- CURLPROTO_RTMP
- CURLPROTO_RTMPT
- CURLPROTO_RTMPE
- CURLPROTO_RTMPTE
- CURLPROTO_RTMPS
- CURLPROTO_RTMPTS
- CURLPROTO_GOPHER
- CURLPROTO_SMB
- CURLPROTO_SMBS
- CURLPROTO_MQTT
- CURLPROTO_GOPHERS
- CURLPROTO_ALL

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

Closes #18136
This commit is contained in:
Viktor Szakats
2025-08-01 16:47:41 +02:00
parent ebbb8e3da7
commit b131db5410
4 changed files with 37 additions and 37 deletions

View File

@@ -1072,37 +1072,37 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
options. Do not use. */
#define CURLPROTO_HTTP (1<<0)
#define CURLPROTO_HTTPS (1<<1)
#define CURLPROTO_FTP (1<<2)
#define CURLPROTO_FTPS (1<<3)
#define CURLPROTO_SCP (1<<4)
#define CURLPROTO_SFTP (1<<5)
#define CURLPROTO_TELNET (1<<6)
#define CURLPROTO_LDAP (1<<7)
#define CURLPROTO_LDAPS (1<<8)
#define CURLPROTO_DICT (1<<9)
#define CURLPROTO_FILE (1<<10)
#define CURLPROTO_TFTP (1<<11)
#define CURLPROTO_IMAP (1<<12)
#define CURLPROTO_IMAPS (1<<13)
#define CURLPROTO_POP3 (1<<14)
#define CURLPROTO_POP3S (1<<15)
#define CURLPROTO_SMTP (1<<16)
#define CURLPROTO_SMTPS (1<<17)
#define CURLPROTO_RTSP (1<<18)
#define CURLPROTO_RTMP (1<<19)
#define CURLPROTO_RTMPT (1<<20)
#define CURLPROTO_RTMPE (1<<21)
#define CURLPROTO_RTMPTE (1<<22)
#define CURLPROTO_RTMPS (1<<23)
#define CURLPROTO_RTMPTS (1<<24)
#define CURLPROTO_GOPHER (1<<25)
#define CURLPROTO_SMB (1<<26)
#define CURLPROTO_SMBS (1<<27)
#define CURLPROTO_MQTT (1<<28)
#define CURLPROTO_GOPHERS (1<<29)
#define CURLPROTO_ALL (~0) /* enable everything */
#define CURLPROTO_HTTP (1L<<0)
#define CURLPROTO_HTTPS (1L<<1)
#define CURLPROTO_FTP (1L<<2)
#define CURLPROTO_FTPS (1L<<3)
#define CURLPROTO_SCP (1L<<4)
#define CURLPROTO_SFTP (1L<<5)
#define CURLPROTO_TELNET (1L<<6)
#define CURLPROTO_LDAP (1L<<7)
#define CURLPROTO_LDAPS (1L<<8)
#define CURLPROTO_DICT (1L<<9)
#define CURLPROTO_FILE (1L<<10)
#define CURLPROTO_TFTP (1L<<11)
#define CURLPROTO_IMAP (1L<<12)
#define CURLPROTO_IMAPS (1L<<13)
#define CURLPROTO_POP3 (1L<<14)
#define CURLPROTO_POP3S (1L<<15)
#define CURLPROTO_SMTP (1L<<16)
#define CURLPROTO_SMTPS (1L<<17)
#define CURLPROTO_RTSP (1L<<18)
#define CURLPROTO_RTMP (1L<<19)
#define CURLPROTO_RTMPT (1L<<20)
#define CURLPROTO_RTMPE (1L<<21)
#define CURLPROTO_RTMPTE (1L<<22)
#define CURLPROTO_RTMPS (1L<<23)
#define CURLPROTO_RTMPTS (1L<<24)
#define CURLPROTO_GOPHER (1L<<25)
#define CURLPROTO_SMB (1L<<26)
#define CURLPROTO_SMBS (1L<<27)
#define CURLPROTO_MQTT (1L<<28)
#define CURLPROTO_GOPHERS (1L<<29)
#define CURLPROTO_ALL (~0L) /* enable everything */
/* long may be 32 or 64 bits, but we should never depend on anything else
but 32 */