windows/direct2d: fix ID2D1RenderTarget::GetPixelFormat() and ID2D1RenderTarget::GetSize() typedefs in MinGW-w64 ABI workaround

MinGW-w64 recently added manual workarounds directly into the class via overloads that make existing Direct2D code source-compatible. However, that exposed an error in my definition of the typedefs I was using in my own workaround: both of these methods are const, even in MSVC, but I neglected to include the const qualifier. I'm not sure how this code compiled in the past, but now the overload resolution engine finds no match.

I want to remain compatible with versions of MinGW-w64 old enough to not have their fix, so our fix remains.

Fixes #446.
This commit is contained in:
Pietro Gagliardi 2019-04-07 21:56:35 -04:00
parent 9c164a2c5c
commit e8daaf659e
2 changed files with 2 additions and 2 deletions

View File

@ -314,7 +314,7 @@ static void drawGrid(ID2D1RenderTarget *rt, D2D1_RECT_F *fillRect)
pformat = rt->GetPixelFormat();
#else
{
typedef D2D1_PIXEL_FORMAT *(__stdcall ID2D1RenderTarget::* GetPixelFormatF)(D2D1_PIXEL_FORMAT *);
typedef D2D1_PIXEL_FORMAT *(__stdcall ID2D1RenderTarget::* GetPixelFormatF)(D2D1_PIXEL_FORMAT *) const;
GetPixelFormatF gpf;
gpf = (GetPixelFormatF) (&(rt->GetPixelFormat));

View File

@ -144,7 +144,7 @@ D2D1_SIZE_F realGetSize(ID2D1RenderTarget *rt)
return rt->GetSize();
#else
D2D1_SIZE_F size;
typedef D2D1_SIZE_F *(__stdcall ID2D1RenderTarget::* GetSizeF)(D2D1_SIZE_F *);
typedef D2D1_SIZE_F *(__stdcall ID2D1RenderTarget::* GetSizeF)(D2D1_SIZE_F *) const;
GetSizeF gs;
gs = (GetSizeF) (&(rt->GetSize));