From: SF/projects/mingw n. l. <min...@li...> - 2010-12-27 20:40:14
|
Patches item #3084516, was opened at 2010-10-09 22:56 Message generated for change (Comment added) made by ir0nh34d You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=3084516&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: w32api Group: None >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Markus Koenig (basilo) >Assigned to: Chris Sutcliffe (ir0nh34d) Summary: GDI+: PixelFormat* broken without "using namespace Gdiplus" Initial Comment: The folks over at the Allegro project have trouble compiling their code with the GDI+ headers provided by MinGW; see this forum entry: <http://www.allegro.cc/forums/thread/605136/883924#target>. The error messages reveal that this is caused by an incorrect definition of the PixelFormat... constants in gdipluspixelformats.h. In particular, Allegro's code if (!gdi_bmp->LockBits(&rect, Gdiplus::ImageLockModeWrite, PixelFormat32bppARGB, gdi_lock)) expands to if (!gdi_bmp->LockBits(&rect, Gdiplus::ImageLockModeWrite, ((PixelFormat) (...)), gdi_lock)) which, since there is a typedef Gdiplus::PixelFormat (for INT) but no namespace-less PixelFormat, breaks apart when "using namespace Gdiplus" is not being used. This patch changes the definition of all PixelFormat... constants such that the cast is done to (for simplicity) INT. An equivalent option would have been to cast to Gdiplus::PixelFormat. A small test case is attached which can't be compiled with w32api headers from CVS but works after the patch is applied. I have also verified that all tests from <https://sourceforge.net/tracker/?func=detail&aid=3007314&group_id=2435&atid=302435> still compile and work as expected. ---------------------------------------------------------------------- Comment By: Chris Sutcliffe (ir0nh34d) Date: 2010-12-27 15:40 Message: Your patch has been accepted and is now commited to CVS. You should expect to see it in the next release. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=3084516&group_id=2435 |