GNOME Bugzilla – Bug 584678
Miscast of a pointer in gstglwindow_win32.c
Last modified: 2009-08-10 23:34:27 UTC
GCC 4.4.0 complains: gstglwindow_win32.c: In function 'gst_gl_window_set_external_window_id': gstglwindow_win32.c:207: error: cast from pointer to integer of different size The offending line is: SetWindowLongPtr ((HWND) id, GWL_WNDPROC, (DWORD) (guint64) sub_class_proc); Prototype for SetWindowLongPtr is: WINUSERAPI LONG_PTR WINAPI SetWindowLongPtrW(HWND,int,LONG_PTR); (on x64) or WINUSERAPI LONG WINAPI SetWindowLongW(HWND,int,LONG); (on x86) In MinGW LONG_PTR is defined as typedef __int64 LONG_PTR, *PLONG_PTR; (on x64) or as typedef long LONG_PTR, *PLONG_PTR; (on x86) and LONG is defined as typedef long LONG; So, on x86 systems the SetWindowLongPtr accepts LONG, LONG_PTR being equivalent to LONG, while on x64 systems it accepts LONG_PTR itself. Both DWORD and guint64 are out of place. In case you're wondering, MSDN says that typedef __int3264 LONG_PTR; which is the same thing. How to fix: replace "(DWORD) (guint64)" with "(LONG_PTR)"
commit 3d6ff87b54547e91a244a020b44fc55d4245635a Author: LRN <lrn1986@gmail.com> Date: Thu Jun 4 00:27:44 2009 +0200 fix miscast of a pointer in SetWindowLongPtr GCC 4.4.0 complains error: cast from pointer to integer of different size Fixes #584678.