--- a/src/osx/webrequest_urlsession.mm 2026-02-28 20:50:12.000000000 +0800 +++ b/src/osx/webrequest_urlsession.mm 2026-05-18 01:32:53.000000000 +0800 @@ -12,7 +12,7 @@ #include "wx/webrequest.h" -#if wxUSE_WEBREQUEST && wxUSE_WEBREQUEST_URLSESSION +#if wxUSE_WEBREQUEST && !wxUSE_WEBREQUEST_CURL #import --- a/src/common/webrequest.cpp 2026-02-28 20:50:12.000000000 +0800 +++ b/src/common/webrequest.cpp 2026-05-18 01:39:11.000000000 +0800 @@ -32,11 +32,10 @@ #if wxUSE_WEBREQUEST_WINHTTP #include "wx/msw/private/webrequest_winhttp.h" #endif -#if wxUSE_WEBREQUEST_URLSESSION -#include "wx/osx/private/webrequest_urlsession.h" -#endif #if wxUSE_WEBREQUEST_CURL #include "wx/private/webrequest_curl.h" +#elif wxUSE_WEBREQUEST_URLSESSION +#include "wx/osx/private/webrequest_urlsession.h" #endif extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendWinHTTP[] = "WinHTTP"; @@ -968,10 +967,10 @@ { #if wxUSE_WEBREQUEST_WINHTTP backend = wxWebSessionBackendWinHTTP; -#elif wxUSE_WEBREQUEST_URLSESSION - backend = wxWebSessionBackendURLSession; #elif wxUSE_WEBREQUEST_CURL backend = wxWebSessionBackendCURL; +#elif wxUSE_WEBREQUEST_URLSESSION + backend = wxWebSessionBackendURLSession; #endif } } @@ -1010,11 +1009,10 @@ #if wxUSE_WEBREQUEST_WINHTTP RegisterFactory(wxWebSessionBackendWinHTTP, new wxWebSessionFactoryWinHTTP()); #endif -#if wxUSE_WEBREQUEST_URLSESSION - RegisterFactory(wxWebSessionBackendURLSession, new wxWebSessionFactoryURLSession()); -#endif #if wxUSE_WEBREQUEST_CURL RegisterFactory(wxWebSessionBackendCURL, new wxWebSessionFactoryCURL()); +#elif wxUSE_WEBREQUEST_URLSESSION + RegisterFactory(wxWebSessionBackendURLSession, new wxWebSessionFactoryURLSession()); #endif } --- a/include/wx/osx/setup.h 2026-02-28 20:50:12.000000000 +0800 +++ b/include/wx/osx/setup.h 2026-05-18 01:15:01.000000000 +0800 @@ -661,11 +661,7 @@ // // Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, // otherwise wxWebRequest won't be available at all under Mac. -#ifdef __APPLE__ -#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST -#else #define wxUSE_WEBREQUEST_URLSESSION 0 -#endif // wxWebRequest backend based on libcurl, can be used under all platforms. // @@ -673,7 +669,7 @@ // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#define wxUSE_WEBREQUEST_CURL 0 +#define wxUSE_WEBREQUEST_CURL 1 // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. --- a/include/wx/gtk/setup.h 2026-02-28 20:50:12.000000000 +0800 +++ b/include/wx/gtk/setup.h 2026-05-18 01:14:04.000000000 +0800 @@ -655,11 +655,7 @@ // // Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, // otherwise wxWebRequest won't be available at all under Mac. -#ifdef __APPLE__ -#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST -#else #define wxUSE_WEBREQUEST_URLSESSION 0 -#endif // wxWebRequest backend based on libcurl, can be used under all platforms. // @@ -667,7 +663,7 @@ // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#define wxUSE_WEBREQUEST_CURL 0 +#define wxUSE_WEBREQUEST_CURL 1 // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1. --- a/include/wx/setup_inc.h 2026-02-28 20:50:12.000000000 +0800 +++ b/include/wx/setup_inc.h 2026-05-18 01:32:09.000000000 +0800 @@ -651,11 +651,7 @@ // // Recommended setting: 1, can be set to 0 if wxUSE_WEBREQUEST_CURL==1, // otherwise wxWebRequest won't be available at all under Mac. -#ifdef __APPLE__ -#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST -#else #define wxUSE_WEBREQUEST_URLSESSION 0 -#endif // wxWebRequest backend based on libcurl, can be used under all platforms. // @@ -663,7 +659,7 @@ // // Recommended setting: 0 on Windows and macOS, otherwise 1 as it is required // for wxWebRequest to be available at all. -#define wxUSE_WEBREQUEST_CURL 0 +#define wxUSE_WEBREQUEST_CURL 1 // wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP // or wxURL you need to set this to 1.