WebKit 和 npapi 和 mingw-w64
问题如下: 在 Windows x64 上,指针是 64 位,但 long 类型是 32 位。 MSVC 似乎并不关心,甚至在默认警告级别上忽略了有关指针截断的警告。 最近,出现了一个针对 x86_64-w64-mingw32 或更好的本机 Windows x64 的 GCC。当指针被截断时,GCC 会产生错误(这是合乎逻辑的事情……),这会在 WebKit(更具体地说,Netscape Plugin API)中造成麻烦: 首先,有文件(我只能发布一个超链接...):
http://trac.webkit.org/browser/trunk/WebCore/< br> 桥/npapi.h -->将 uint32 定义为 32 位 int 类型(~第 145 行)
插件/win/PluginViewWin.cpp --> 为 32 位 int,并截断它们(~第 450 行)
将 Windows 窗口句柄强制转换 。我不知道如何解决这个问题,因为显然 WebKit 很乐意在 Win64 上截断指针......
我怎样才能以正确的方式解决这个问题?谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于任何感兴趣的人,我已将 uint32 lparam、wparam 更改为 uintptr_t。这是一个仅在 Windows 中可见的更改,恕我直言,它肯定是正确的修复。
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.