summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortastytea2020-01-10 17:43:50 +0100
committertastytea2020-01-10 17:43:50 +0100
commitf601e770ac2f74aef0fcead977ff0bd95ce57f99 (patch)
tree4cccb2ccf834e5fae878435378669758e3794b86 /src
parent20167fdce3e9412440131632ed06b84db0a976b5 (diff)
downloadmastodonpp-f601e770ac2f74aef0fcead977ff0bd95ce57f99.tar
mastodonpp-f601e770ac2f74aef0fcead977ff0bd95ce57f99.tar.gz
mastodonpp-f601e770ac2f74aef0fcead977ff0bd95ce57f99.zip
Define CURLAUTH_BEARER as CURLAUTH_ANY with libcurl < 7.61.0
Diffstat (limited to 'src')
-rw-r--r--src/curl_wrapper.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp
index 97894e0..cf6adfe 100644
--- a/src/curl_wrapper.cpp
+++ b/src/curl_wrapper.cpp
@@ -183,17 +183,12 @@ void CURLWrapper::set_access_token(const string_view access_token)
_curl_buffer_error};
}
- #if LIBCURL_VERSION_NUM >= 0x073d00 // libcurl >= 7.61.0.
- {
- //NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-signed-bitwise)
- code = curl_easy_setopt(_connection, CURLOPT_HTTPAUTH, CURLAUTH_BEARER);
- }
- #else
- {
- //NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-signed-bitwise)
- code = curl_easy_setopt(_connection, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
- }
- #endif
+#if (LIBCURL_VERSION_NUM < 0x073d00) // libcurl < 7.61.0.
+#define CURLAUTH_BEARER CURLAUTH_ANY
+#endif
+
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg, hicpp-signed-bitwise)
+ code = curl_easy_setopt(_connection, CURLOPT_HTTPAUTH, CURLAUTH_BEARER);
if (code != CURLE_OK)
{
throw CURLException{code, "Could not set authorization token.",