Bug 1895428: Fix MinGW build error and warning in accessibility code. r=yjuglaret

Differential Revision: https://phabricator.services.mozilla.com/D210401
This commit is contained in:
James Teh 2024-05-15 09:08:07 +00:00
parent 27ef1fa8ac
commit 1ad35e5b84
2 changed files with 31 additions and 21 deletions

View File

@ -47,31 +47,31 @@ class AutoRefCnt {
} // namespace a11y
} // namespace mozilla
#define DECL_IUNKNOWN \
public: \
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**); \
ULONG STDMETHODCALLTYPE AddRef() override { \
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt"); \
++mRefCnt; \
return mRefCnt; \
} \
ULONG STDMETHODCALLTYPE Release() override { \
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); \
--mRefCnt; \
if (mRefCnt) return mRefCnt; \
\
delete this; \
return 0; \
} \
\
private: \
mozilla::a11y::AutoRefCnt mRefCnt; \
\
#define DECL_IUNKNOWN \
public: \
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**) override; \
ULONG STDMETHODCALLTYPE AddRef() override { \
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt"); \
++mRefCnt; \
return mRefCnt; \
} \
ULONG STDMETHODCALLTYPE Release() override { \
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); \
--mRefCnt; \
if (mRefCnt) return mRefCnt; \
\
delete this; \
return 0; \
} \
\
private: \
mozilla::a11y::AutoRefCnt mRefCnt; \
\
public:
#define DECL_IUNKNOWN_INHERITED \
public: \
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**);
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**) override;
#define IMPL_IUNKNOWN_QUERY_HEAD(Class) \
STDMETHODIMP \

View File

@ -31,6 +31,16 @@
using namespace mozilla;
using namespace mozilla::a11y;
#ifdef __MINGW32__
// These constants are missing in mingw-w64. This code should be removed once
// we update to a version which includes them.
const long UIA_CustomLandmarkTypeId = 80000;
const long UIA_FormLandmarkTypeId = 80001;
const long UIA_MainLandmarkTypeId = 80002;
const long UIA_NavigationLandmarkTypeId = 80003;
const long UIA_SearchLandmarkTypeId = 80004;
#endif // __MINGW32__
// Helper functions
static ToggleState ToToggleState(uint64_t aState) {