I am using libcurl setting OAuth 2.0 access token. Since libcurl 7.33 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_XOAUTH2_BEARER, char *token);
option was added. Now I need to get the libcurl version and compare it with 7.33. In case where version is 7.33 or higher I will use CURLOPT_XOAUTH2_BEARER otherwise I will do something else.
I know I should somehow use curl_version_info_data *curl_version_info( CURLversion type );
but I have no idea, how the data in struct look like and how to compare them to 7.33 version.
Can someone help me?
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
- Equivalent of std::pair in C
If you want to detect version at run-time, you can use curl_version_info() in a style like this:
If you prefer to do the detection build-time, you can use a preprocessor #if expression like this:
As Daniel said, or even just: