From 71550a8665d861384332d81239ca0c1586a17137 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 28 Jan 2011 20:17:22 +0000 Subject: [PATCH] Cygwin/X: Decorate function pointers retrieved via GetProcAddress with WINAPI Decorate function pointers retrieved via GetProcAddress which are currently missing it with WINAPI, to ensure stdcall convention is used when calling them. This fixes a crash currently seen when compiled -O2 and the -screen option uses a size and monitor number e.g. -screen 0 1280x1000@2 Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison Tested-by: Colin Harrison --- hw/xwin/InitOutput.c | 2 +- hw/xwin/winmonitors.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 7faed0170..22ef8da76 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -49,7 +49,7 @@ from The Open Group. #endif #ifdef RELOCATE_PROJECTROOT #include -typedef HRESULT (*SHGETFOLDERPATHPROC)( +typedef WINAPI HRESULT (*SHGETFOLDERPATHPROC)( HWND hwndOwner, int nFolder, HANDLE hToken, diff --git a/hw/xwin/winmonitors.c b/hw/xwin/winmonitors.c index 63af803d0..a9d46f90e 100644 --- a/hw/xwin/winmonitors.c +++ b/hw/xwin/winmonitors.c @@ -53,7 +53,7 @@ wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _d return TRUE; } -typedef wBOOL (*ENUMDISPLAYMONITORSPROC)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); +typedef WINAPI wBOOL (*ENUMDISPLAYMONITORSPROC)(HDC,LPCRECT,MONITORENUMPROC,LPARAM); ENUMDISPLAYMONITORSPROC _EnumDisplayMonitors; wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data);