Question

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 targets x86_64-w64-mingw32, or better native Windows x64. 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!

Was it helpful?

Solution

For anyone interested, I have changed the uint32 lparam, wparam to uintptr_t's. It is a cange only visible in Windows, where it is certainly the correct fix IMHO.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top