Avoid including curl.h in dialog about (including curl.h creates constraints with wxWidgets especially on Windows)
and remove duplicate code.
This commit is contained in:
parent
1fe91e6252
commit
6ea6c7219a
|
@ -24,12 +24,16 @@
|
||||||
|
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
// kicad_curl.h must be included before wx headers, to avoid
|
// kicad_curl.h must be included before wx headers, to avoid
|
||||||
// conflicts for some defines, at least on Windows
|
// conflicts for some defines, at least on Windows
|
||||||
#ifdef BUILD_GITHUB_PLUGIN
|
#ifdef BUILD_GITHUB_PLUGIN
|
||||||
#include <curl/curlver.h>
|
// kicad_curl.h can create conflicts for some defines, at least on Windows
|
||||||
#include <kicad_curl/kicad_curl.h>
|
// so we are using here 2 proxy functions to know Curl version to avoid
|
||||||
|
// including kicad_curl.h to know Curl version
|
||||||
|
extern std::string GetKicadCurlVersion();
|
||||||
|
extern std::string GetCurlLibVersion();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/version.hpp>
|
#include <boost/version.hpp>
|
||||||
|
@ -426,7 +430,7 @@ void DIALOG_ABOUT::buildVersionInfoData( wxString& aMsg, bool aFormatHtml )
|
||||||
aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
|
aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
|
||||||
|
|
||||||
#ifdef BUILD_GITHUB_PLUGIN
|
#ifdef BUILD_GITHUB_PLUGIN
|
||||||
aMsg << indent4 << KICAD_CURL::GetVersion() << eol;
|
aMsg << indent4 << GetKicadCurlVersion() << eol;
|
||||||
#endif
|
#endif
|
||||||
aMsg << "Platform: " << wxGetOsDescription() << ", "
|
aMsg << "Platform: " << wxGetOsDescription() << ", "
|
||||||
<< platform.GetArchName() << ", "
|
<< platform.GetArchName() << ", "
|
||||||
|
@ -453,7 +457,7 @@ void DIALOG_ABOUT::buildVersionInfoData( wxString& aMsg, bool aFormatHtml )
|
||||||
<< ( BOOST_VERSION % 100 ) << eol;
|
<< ( BOOST_VERSION % 100 ) << eol;
|
||||||
|
|
||||||
#ifdef BUILD_GITHUB_PLUGIN
|
#ifdef BUILD_GITHUB_PLUGIN
|
||||||
aMsg << indent4 << "Curl: " << LIBCURL_VERSION << eol;
|
aMsg << indent4 << "Curl: " << GetCurlLibVersion() << eol;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aMsg << indent4 << "Compiler: ";
|
aMsg << indent4 << "Compiler: ";
|
||||||
|
|
|
@ -222,3 +222,13 @@ std::string KICAD_CURL::GetSimpleVersion()
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetKicadCurlVersion()
|
||||||
|
{
|
||||||
|
return KICAD_CURL::GetVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GetCurlLibVersion()
|
||||||
|
{
|
||||||
|
return LIBCURL_VERSION;
|
||||||
|
}
|
||||||
|
|
|
@ -26,25 +26,12 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* KICAD_CURL_EASY.h must included before wxWidgets because on Windows,
|
* KICAD_CURL_EASY.h must included before wxWidgets because on Windows,
|
||||||
* wxWidgets ends up including windows.h before winsocks2.h inside curl
|
* because kicad_curl.h includes curl.h, wxWidgets ends up including windows.h
|
||||||
* this causes build warnings
|
* before winsocks2.h inside curl and this causes build warnings
|
||||||
* Because we are before wx, we must explicitly define we are building with unicode
|
|
||||||
* wxWidgets defaults to supporting unicode now, so this should be safe.
|
|
||||||
*/
|
*/
|
||||||
#if defined(WIN32)
|
|
||||||
#ifndef UNICODE
|
|
||||||
# define UNICODE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _UNICODE
|
|
||||||
# define _UNICODE
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <curl/curl.h>
|
|
||||||
#include <kicad_curl/kicad_curl.h>
|
#include <kicad_curl/kicad_curl.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue