Avoid using IE-related symbols not present in old MinGW headers

Define INET_E_DEFAULT_ACTION ourselves and provide stand-ins for the
enums not present in MinGW SDK.

See #17893.
This commit is contained in:
Vadim Zeitlin
2020-07-21 17:46:37 +02:00
parent 5c1f7733ab
commit cd2cd6a617
3 changed files with 27 additions and 8 deletions

View File

@@ -122,7 +122,7 @@ public:
DWORD cchResult, DWORD *pcchResult, DWORD cchResult, DWORD *pcchResult,
DWORD dwReserved) wxOVERRIDE; DWORD dwReserved) wxOVERRIDE;
HRESULT STDMETHODCALLTYPE ParseUrl( HRESULT STDMETHODCALLTYPE ParseUrl(
LPCWSTR pwzUrl, PARSEACTION ParseAction, LPCWSTR pwzUrl, wxPARSEACTION ParseAction,
DWORD dwParseFlags, LPWSTR pwzResult, DWORD dwParseFlags, LPWSTR pwzResult,
DWORD cchResult, DWORD *pcchResult, DWORD cchResult, DWORD *pcchResult,
DWORD dwReserved) wxOVERRIDE; DWORD dwReserved) wxOVERRIDE;
@@ -131,7 +131,7 @@ public:
LPCWSTR pwzUrl2, LPCWSTR pwzUrl2,
DWORD dwCompareFlags) wxOVERRIDE; DWORD dwCompareFlags) wxOVERRIDE;
HRESULT STDMETHODCALLTYPE QueryInfo( HRESULT STDMETHODCALLTYPE QueryInfo(
LPCWSTR pwzUrl, QUERYOPTION OueryOption, LPCWSTR pwzUrl, wxQUERYOPTION OueryOption,
DWORD dwQueryFlags, LPVOID pBuffer, DWORD dwQueryFlags, LPVOID pBuffer,
DWORD cbBuffer, DWORD *pcbBuf, DWORD cbBuffer, DWORD *pcbBuf,
DWORD dwReserved) wxOVERRIDE; DWORD dwReserved) wxOVERRIDE;

View File

@@ -27,6 +27,10 @@ struct IHTMLDocument2;
#define REFRESH_COMPLETELY 3 #define REFRESH_COMPLETELY 3
#endif #endif
#ifndef INET_E_DEFAULT_ACTION
#define INET_E_DEFAULT_ACTION ((HRESULT)0x800C0011L)
#endif
typedef enum __wxMIDL_IBindStatusCallback_0006 typedef enum __wxMIDL_IBindStatusCallback_0006
{ {
wxBSCF_FIRSTDATANOTIFICATION = 0x1, wxBSCF_FIRSTDATANOTIFICATION = 0x1,
@@ -136,11 +140,26 @@ public:
DWORD dwReserved) = 0; DWORD dwReserved) = 0;
}; };
// This interface uses a couple of enums which are not defined in old MinGW
// SDK headers, but we don't have any reliable way to test if they're actually
// defined, so define our own enums, containing just the values we need: this
// compiles everywhere and is ABI-compatible with the real enums.
enum wxPARSEACTION
{
wxPARSE_SECURITY_URL = 3,
wxPARSE_SECURITY_DOMAIN = 17
};
enum wxQUERYOPTION
{
// We don't actually need any values in this one.
};
class wxIInternetProtocolInfo : public IUnknown class wxIInternetProtocolInfo : public IUnknown
{ {
public: public:
virtual HRESULT STDMETHODCALLTYPE ParseUrl(LPCWSTR pwzUrl, virtual HRESULT STDMETHODCALLTYPE ParseUrl(LPCWSTR pwzUrl,
PARSEACTION ParseAction, wxPARSEACTION ParseAction,
DWORD dwParseFlags, DWORD dwParseFlags,
LPWSTR pwzResult, LPWSTR pwzResult,
DWORD cchResult, DWORD cchResult,
@@ -160,7 +179,7 @@ public:
DWORD dwCompareFlags) = 0; DWORD dwCompareFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE QueryInfo(LPCWSTR pwzUrl, virtual HRESULT STDMETHODCALLTYPE QueryInfo(LPCWSTR pwzUrl,
QUERYOPTION OueryOption, wxQUERYOPTION OueryOption,
DWORD dwQueryFlags, DWORD dwQueryFlags,
LPVOID pBuffer, LPVOID pBuffer,
DWORD cbBuffer, DWORD cbBuffer,

View File

@@ -1762,7 +1762,7 @@ HRESULT STDMETHODCALLTYPE VirtualProtocol::CombineUrl(
} }
HRESULT STDMETHODCALLTYPE VirtualProtocol::ParseUrl( HRESULT STDMETHODCALLTYPE VirtualProtocol::ParseUrl(
LPCWSTR pwzUrl, PARSEACTION ParseAction, LPCWSTR pwzUrl, wxPARSEACTION ParseAction,
DWORD dwParseFlags, LPWSTR pwzResult, DWORD dwParseFlags, LPWSTR pwzResult,
DWORD cchResult, DWORD *pcchResult, DWORD cchResult, DWORD *pcchResult,
DWORD dwReserved) DWORD dwReserved)
@@ -1777,8 +1777,8 @@ HRESULT STDMETHODCALLTYPE VirtualProtocol::ParseUrl(
switch (ParseAction) switch (ParseAction)
{ {
case PARSE_SECURITY_URL: case wxPARSE_SECURITY_URL:
case PARSE_SECURITY_DOMAIN: case wxPARSE_SECURITY_DOMAIN:
{ {
LPWSTR Result = L"http://localhost"; LPWSTR Result = L"http://localhost";
size_t Len = wcslen(Result); size_t Len = wcslen(Result);
@@ -1806,7 +1806,7 @@ HRESULT STDMETHODCALLTYPE VirtualProtocol::CompareUrl(
} }
HRESULT STDMETHODCALLTYPE VirtualProtocol::QueryInfo( HRESULT STDMETHODCALLTYPE VirtualProtocol::QueryInfo(
LPCWSTR pwzUrl, QUERYOPTION OueryOption, LPCWSTR pwzUrl, wxQUERYOPTION OueryOption,
DWORD dwQueryFlags, LPVOID pBuffer, DWORD dwQueryFlags, LPVOID pBuffer,
DWORD cbBuffer, DWORD *pcbBuf, DWORD cbBuffer, DWORD *pcbBuf,
DWORD dwReserved) DWORD dwReserved)