Skip to content

Commit d1cf3f7

Browse files
authored
lazycurl: prepare for new upstream Git requirements (git-for-windows#5102)
An [upcoming change in Git](git@0ca365c) wants it to call `curl_version_info()`, which the lazy cURL stuff hereby learns about.
2 parents 28481d4 + 6fe9491 commit d1cf3f7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compat/lazyload-curl.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ static func_t load_function(void *handle, const char *name)
8888
}
8989
#endif
9090

91+
typedef struct curl_version_info_data *(*curl_version_info_type)(CURLversion version);
92+
static curl_version_info_type curl_version_info_func;
93+
9194
typedef char *(*curl_easy_escape_type)(CURL *handle, const char *string, int length);
9295
static curl_easy_escape_type curl_easy_escape_func;
9396

@@ -192,6 +195,7 @@ static void lazy_load_curl(void)
192195
if (!libcurl)
193196
die("failed to load library '%s'", LIBCURL_FILE_NAME("libcurl"));
194197

198+
curl_version_info_func = (curl_version_info_type)load_function(libcurl, "curl_version_info");
195199
curl_easy_escape_func = (curl_easy_escape_type)load_function(libcurl, "curl_easy_escape");
196200
curl_free_func = (curl_free_type)load_function(libcurl, "curl_free");
197201
curl_global_init_func = (curl_global_init_type)load_function(libcurl, "curl_global_init");
@@ -225,6 +229,12 @@ static void lazy_load_curl(void)
225229
curl_easy_setopt_off_t_func = (curl_easy_setopt_off_t_type)curl_easy_setopt_func;
226230
}
227231

232+
struct curl_version_info_data *curl_version_info(CURLversion version)
233+
{
234+
lazy_load_curl();
235+
return curl_version_info_func(version);
236+
}
237+
228238
char *curl_easy_escape(CURL *handle, const char *string, int length)
229239
{
230240
lazy_load_curl();

0 commit comments

Comments
 (0)