From ab73b0a564aee713e3985974d346297d8032b574 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 22 Mar 2016 19:54:59 +0100 Subject: [PATCH] core.sys.windows.winuser: Provide valid GetMonitorInfo overloads LDC isn't fooled by using the same mangled name for multiple C function declarations with differing signatures (see DMD bugzilla 15217). In the MS header, the ...EX structs derive from the non-EX ones, so a pointer to an EX struct is implicitly converted to a pointer to the base struct. Provide extern(D) wrappers performing the explicitly required cast in D. --- src/core/sys/windows/winuser.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/sys/windows/winuser.d b/src/core/sys/windows/winuser.d index 4b7d8449c70..cb86b169ef4 100644 --- a/src/core/sys/windows/winuser.d +++ b/src/core/sys/windows/winuser.d @@ -4423,9 +4423,9 @@ int BroadcastSystemMessageW(DWORD, LPDWORD, UINT, WPARAM, LPARAM); UINT SendInput(UINT, LPINPUT, int); BOOL EnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM); BOOL GetMonitorInfoA(HMONITOR, LPMONITORINFO); -BOOL GetMonitorInfoA(HMONITOR, LPMONITORINFOEXA); +extern(D) BOOL GetMonitorInfoA(HMONITOR m, LPMONITORINFOEXA mi) { return GetMonitorInfoA(m, cast(LPMONITORINFO)mi); } BOOL GetMonitorInfoW(HMONITOR, LPMONITORINFO); -BOOL GetMonitorInfoW(HMONITOR, LPMONITORINFOEXW); +extern(D) BOOL GetMonitorInfoW(HMONITOR m, LPMONITORINFOEXW mi) { return GetMonitorInfoW(m, cast(LPMONITORINFO)mi); } HMONITOR MonitorFromPoint(POINT, DWORD); HMONITOR MonitorFromRect(LPCRECT, DWORD); HMONITOR MonitorFromWindow(HWND, DWORD);