From 5f530c5bf73e833b062d40c7c6db81c68bb3fb1f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 9 Dec 2015 15:36:56 -0500 Subject: [PATCH] More MinGW stuff. --- README.md | 1 + windows/area.c | 13 +------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b96697bf..03a7e5d2 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ This README is being written. * MinGW is currently unsupported. MinGW-w64 support will be re-added once the following features come in: * [Isolation awareness](https://msdn.microsoft.com/en-us/library/aa375197%28v=vs.85%29.aspx) * Linker symbols for some functions such as `TaskDialog()` (which I thought I submitted...) + * [A bug in the definition of the C macro `ID2D1RenderTarget_GetSize()`](https://sourceforge.net/p/mingw-w64/mailman/message/33176880/) * Unix: nothing specific * Mac OS X: nothing specific, so long as you can build Cocoa programs diff --git a/windows/area.c b/windows/area.c index 8889f9af..a0b9a9e4 100644 --- a/windows/area.c +++ b/windows/area.c @@ -24,17 +24,6 @@ uiWindowsDefineControl( uiAreaType // type function ) -// see https://sourceforge.net/p/mingw-w64/mailman/message/33176880/ -// TODO highly unsafe code -static void rtGetSize(ID2D1RenderTarget *rt, D2D1_SIZE_F *size) -{ - typedef void (STDMETHODCALLTYPE *gsp)(ID2D1RenderTarget *, D2D1_SIZE_F *); - gsp gs; - - gs = (gsp) (rt->lpVtbl->GetSize); - (*gs)(rt, size); -} - static HRESULT doPaint(uiArea *a, ID2D1RenderTarget *rt, RECT *clip) { uiAreaHandler *ah = a->ah; @@ -45,7 +34,7 @@ static HRESULT doPaint(uiArea *a, ID2D1RenderTarget *rt, RECT *clip) dp.Context = newContext(rt); - rtGetSize(rt, &size); + ID2D1RenderTarget_GetSize(rt, &size); dp.ClientWidth = size.width; dp.ClientHeight = size.height;