@@ -2061,15 +2061,17 @@ static void free_cb(void *arg) /* {{{ */
2061
2061
/* }}} */
2062
2062
#endif
2063
2063
2064
+ #if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
2064
2065
static inline CURLcode add_simple_field (curl_mime * mime , zend_string * string_key , zval * current )
2066
+ #else
2067
+ static inline CURLcode add_simple_field (struct HttpPost * * first , struct HttpPost * * last , zend_string * string_key , zval * current )
2068
+ #endif
2065
2069
{
2066
2070
CURLcode error = CURLE_OK ;
2067
2071
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
2068
2072
curl_mimepart * part ;
2069
2073
CURLcode form_error ;
2070
2074
#else
2071
- struct HttpPost * first = NULL ;
2072
- struct HttpPost * last = NULL ;
2073
2075
CURLFORMcode form_error ;
2074
2076
#endif
2075
2077
zend_string * postval , * tmp_postval ;
@@ -2091,7 +2093,7 @@ static inline CURLcode add_simple_field(curl_mime *mime, zend_string *string_key
2091
2093
/* The arguments after _NAMELENGTH and _CONTENTSLENGTH
2092
2094
* must be explicitly cast to long in curl_formadd
2093
2095
* use since curl needs a long not an int. */
2094
- form_error = curl_formadd (& first , & last ,
2096
+ form_error = curl_formadd (first , last ,
2095
2097
CURLFORM_COPYNAME , ZSTR_VAL (string_key ),
2096
2098
CURLFORM_NAMELENGTH , ZSTR_LEN (string_key ),
2097
2099
CURLFORM_COPYCONTENTS , ZSTR_VAL (postval ),
@@ -2303,14 +2305,22 @@ static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpo
2303
2305
zval * current_element ;
2304
2306
2305
2307
ZEND_HASH_FOREACH_VAL (HASH_OF (current ), current_element ) {
2308
+ #if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
2306
2309
add_simple_field (mime , string_key , current_element );
2310
+ #else
2311
+ add_simple_field (& first , & last , string_key , current_element );
2312
+ #endif
2307
2313
} ZEND_HASH_FOREACH_END ();
2308
2314
2309
2315
zend_string_release_ex (string_key , 0 );
2310
2316
continue ;
2311
2317
}
2312
2318
2319
+ #if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
2313
2320
add_simple_field (mime , string_key , current );
2321
+ #else
2322
+ add_simple_field (& first , & last , string_key , current );
2323
+ #endif
2314
2324
2315
2325
zend_string_release_ex (string_key , 0 );
2316
2326
} ZEND_HASH_FOREACH_END ();
0 commit comments