WebKit and npapi and mingw-w64

Posted by rubenvb on Stack Overflow See other posts from Stack Overflow or by rubenvb
Published on 2010-04-18T08:41:43Z Indexed on 2010/04/18 8:43 UTC
Read the original article Hit count: 387

Filed under:
|
|
|
|

Hi,

The problem is the following: On Windows x64, pointers are 64-bit, but type long is 32-bit. MSVC doesn't seem to care, and even omits warnings about pointer truncation on the default warning level. Since recently, there is a GCC that target x86_64-w64-mingw32, or better Windows x64 native. GCC produces errors when pointers are truncated (which is the logical thing to do...), and this is causing trouble in WebKit and more specifically, the Netscape Plugin API: First, there's the files (I can only post one hyperlink...):
http://trac.webkit.org/browser/trunk/WebCore/
bridge/npapi.h --> defines uint32 as 32-bit int type (~line 145)
plugins/win/PluginViewWin.cpp --> casts Windows window handles to 32-bit int, truncating them (~line 450)

My proposed fix was to change the uint32 casts to uintptr_t, which makes GCC happy, but still puts a 64-bit value in a uint32 (=unsigned long). I have no clue how to solve this, because clearly WebKit is happy truncating pointers on Win64...

How can I solve this the right way? Thanks!

© Stack Overflow or respective owner

Related posts about webkit

Related posts about win64