Skip to content

Commit 7f44ab8

Browse files
committed
ext/curl: Update libcurl ver comparison preprocessors to contain human-friendly version names
Adds missing human-friendly version number comments where missing.
1 parent 94f5a95 commit 7f44ab8

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

ext/curl/curl_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typedef struct {
7575
php_curl_callback *progress;
7676
php_curl_callback *xferinfo;
7777
php_curl_callback *fnmatch;
78-
#if LIBCURL_VERSION_NUM >= 0x075400
78+
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
7979
php_curl_callback *sshhostkey;
8080
#endif
8181
} php_curl_handlers;

ext/curl/interface.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,20 @@ PHP_MINFO_FUNCTION(curl)
293293
{"HTTPS_PROXY", CURL_VERSION_HTTPS_PROXY},
294294
{"MULTI_SSL", CURL_VERSION_MULTI_SSL},
295295
{"BROTLI", CURL_VERSION_BROTLI},
296-
#if LIBCURL_VERSION_NUM >= 0x074001 /* 7.64.1 */
296+
#if LIBCURL_VERSION_NUM >= 0x074001 /* Available since 7.64.1 */
297297
{"ALTSVC", CURL_VERSION_ALTSVC},
298298
#endif
299-
#if LIBCURL_VERSION_NUM >= 0x074200 /* 7.66.0 */
299+
#if LIBCURL_VERSION_NUM >= 0x074200 /* Available since 7.66.0 */
300300
{"HTTP3", CURL_VERSION_HTTP3},
301301
#endif
302-
#if LIBCURL_VERSION_NUM >= 0x074800 /* 7.72.0 */
302+
#if LIBCURL_VERSION_NUM >= 0x074800 /* Available since 7.72.0 */
303303
{"UNICODE", CURL_VERSION_UNICODE},
304304
{"ZSTD", CURL_VERSION_ZSTD},
305305
#endif
306-
#if LIBCURL_VERSION_NUM >= 0x074a00 /* 7.74.0 */
306+
#if LIBCURL_VERSION_NUM >= 0x074a00 /* Available since 7.74.0 */
307307
{"HSTS", CURL_VERSION_HSTS},
308308
#endif
309-
#if LIBCURL_VERSION_NUM >= 0x074c00 /* 7.76.0 */
309+
#if LIBCURL_VERSION_NUM >= 0x074c00 /* Available since 7.76.0 */
310310
{"GSASL", CURL_VERSION_GSASL},
311311
#endif
312312
{NULL, 0}
@@ -499,7 +499,7 @@ static HashTable *curl_get_gc(zend_object *object, zval **table, int *n)
499499
zend_get_gc_buffer_add_zval(gc_buffer, &curl->handlers.fnmatch->func_name);
500500
}
501501

502-
#if LIBCURL_VERSION_NUM >= 0x075400
502+
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
503503
if (curl->handlers.sshhostkey) {
504504
zend_get_gc_buffer_add_zval(gc_buffer, &curl->handlers.sshhostkey->func_name);
505505
}
@@ -756,7 +756,7 @@ static size_t curl_xferinfo(void *clientp, curl_off_t dltotal, curl_off_t dlnow,
756756
}
757757
/* }}} */
758758

759-
#if LIBCURL_VERSION_NUM >= 0x075400
759+
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
760760
static int curl_ssh_hostkeyfunction(void *clientp, int keytype, const char *key, size_t keylen)
761761
{
762762
php_curl *ch = (php_curl *)clientp;
@@ -1057,7 +1057,7 @@ void init_curl_handle(php_curl *ch)
10571057
ch->handlers.progress = NULL;
10581058
ch->handlers.xferinfo = NULL;
10591059
ch->handlers.fnmatch = NULL;
1060-
#if LIBCURL_VERSION_NUM >= 0x075400
1060+
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
10611061
ch->handlers.sshhostkey = NULL;
10621062
#endif
10631063
ch->clone = emalloc(sizeof(uint32_t));
@@ -1233,7 +1233,7 @@ void _php_setup_easy_copy_handlers(php_curl *ch, php_curl *source)
12331233
_php_copy_callback(ch, &ch->handlers.progress, source->handlers.progress, CURLOPT_PROGRESSDATA);
12341234
_php_copy_callback(ch, &ch->handlers.xferinfo, source->handlers.xferinfo, CURLOPT_XFERINFODATA);
12351235
_php_copy_callback(ch, &ch->handlers.fnmatch, source->handlers.fnmatch, CURLOPT_FNMATCH_DATA);
1236-
#if LIBCURL_VERSION_NUM >= 0x075400
1236+
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
12371237
_php_copy_callback(ch, &ch->handlers.sshhostkey, source->handlers.sshhostkey, CURLOPT_SSH_HOSTKEYDATA);
12381238
#endif
12391239

@@ -2783,7 +2783,7 @@ static void curl_free_obj(zend_object *object)
27832783
_php_curl_free_callback(ch->handlers.progress);
27842784
_php_curl_free_callback(ch->handlers.xferinfo);
27852785
_php_curl_free_callback(ch->handlers.fnmatch);
2786-
#if LIBCURL_VERSION_NUM >= 0x075400
2786+
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
27872787
_php_curl_free_callback(ch->handlers.sshhostkey);
27882788
#endif
27892789

@@ -2866,7 +2866,7 @@ static void _php_curl_reset_handlers(php_curl *ch)
28662866
ch->handlers.fnmatch = NULL;
28672867
}
28682868

2869-
#if LIBCURL_VERSION_NUM >= 0x075400
2869+
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
28702870
if (ch->handlers.sshhostkey) {
28712871
zval_ptr_dtor(&ch->handlers.sshhostkey->func_name);
28722872
efree(ch->handlers.sshhostkey);

ext/curl/multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static bool _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue
449449
zend_long lval = zval_get_long(zvalue);
450450

451451
if (option == CURLMOPT_PIPELINING && (lval & 1)) {
452-
#if LIBCURL_VERSION_NUM >= 0x073e00 /* 7.62.0 */
452+
#if LIBCURL_VERSION_NUM >= 0x073e00 /* Available since 7.62.0 */
453453
php_error_docref(NULL, E_WARNING, "CURLPIPE_HTTP1 is no longer supported");
454454
#else
455455
php_error_docref(NULL, E_DEPRECATED, "CURLPIPE_HTTP1 is deprecated");

0 commit comments

Comments
 (0)