From 4e27e91b2f4c289247e3ab28a0dd0438961eb6ba Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 25 Mar 2023 10:17:06 +0100 Subject: [PATCH] KICAD_CURL_EASY: fix compil warnings (avoid using deprecated functions) --- common/kicad_curl/kicad_curl_easy.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/kicad_curl/kicad_curl_easy.cpp b/common/kicad_curl/kicad_curl_easy.cpp index ba51531f51..b639e91402 100644 --- a/common/kicad_curl/kicad_curl_easy.cpp +++ b/common/kicad_curl/kicad_curl_easy.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015 Mark Roszko - * Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -100,12 +100,13 @@ static int xferinfo( void* aProgress, curl_off_t aDLtotal, curl_off_t aDLnow, cu return CURLE_OK; } - +#if LIBCURL_VERSION_NUM < 0x072000 // 7.32.0 static int progressinfo( void* aProgress, double aDLtotal, double aDLnow, double aULtotal, double aULnow ) { return xferinfo( aProgress, static_cast( aDLtotal ), static_cast( aDLnow ), static_cast( aULtotal ), static_cast( aULnow ) ); } +#endif KICAD_CURL_EASY::KICAD_CURL_EASY() : @@ -126,7 +127,11 @@ KICAD_CURL_EASY::KICAD_CURL_EASY() : curl_easy_setopt( m_CURL, CURLOPT_WRITEDATA, static_cast( &m_buffer ) ); // Only allow HTTP and HTTPS protocols +#if LIBCURL_VERSION_NUM >= 0x075500 // version 7.85.0 + curl_easy_setopt(m_CURL, CURLOPT_PROTOCOLS_STR, "http,https"); +#else curl_easy_setopt( m_CURL, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS ); +#endif #ifdef _WIN32 // We need this to use the Windows Certificate store