Simplify wxUSE_WEBREQUEST_XXX logic

Remove automatic definition of wxUSE_WEBREQUEST depending on whether
wxUSE_WEBREQUEST_XXX are defined and follow the same approach as with
wxUSE_GRAPHICS_XXX, i.e. define wxUSE_WEBREQUEST_XXX as wxUSE_WEBREQUEST
by default instead.

Move wxUSE_WEBREQUEST_WINHTTP to wxMSW-specific file, it doesn't need to
be in common one (unfortunately this can't be done for the Mac-specific
wxUSE_WEBREQUEST_URLSESSION yet, because macOS-specific settings are not
injected into setup.h.in currently).

Also fix test for winhttp.h availability: it seems to be present in all
MinGW64 distributions, but not in MinGW32, so test for this and not for
gcc version.

Finally remove the now unnecessary test for macOS 10.9, as we only
support 10.10+ anyhow by now.
This commit is contained in:
Vadim Zeitlin
2020-12-13 15:51:12 +01:00
parent b7450f52ff
commit 181be127a5
10 changed files with 161 additions and 251 deletions

View File

@@ -8,7 +8,7 @@
///////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// Graphics backends choices for Windows
// Windows-specific backends choices
// ----------------------------------------------------------------------------
// The options here are only taken into account if wxUSE_GRAPHICS_CONTEXT is 1.
@@ -36,6 +36,20 @@
#define wxUSE_GRAPHICS_DIRECT2D 0
#endif
// wxWebRequest backend based on WinHTTP.
//
// This is only taken into account if wxUSE_WEBREQUEST==1.
//
// Default is 1 if supported by the compiler (MSVS or MinGW64).
//
// Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1,
// otherwise wxWebRequest won't be available at all.
#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
#define wxUSE_WEBREQUEST_WINHTTP 1
#else
#define wxUSE_WEBREQUEST_WINHTTP 0
#endif
// ----------------------------------------------------------------------------
// Windows-only settings
// ----------------------------------------------------------------------------