From 235d5dde5c81d92a2a1254f81921c8221687b465 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 12 Feb 2014 23:59:17 +0200 Subject: [PATCH] Force alignment for SSE2 to not crash with mingw Make sure that stacks are properly aligned by replacing CALLBACK with QT_WIN_CALLBACK so that we don't crash in SSE2 code. Task-number: QTBUG-36807 Change-Id: I6952d0f252c7b8e481c48521ed1377b7d7510e15 Reviewed-by: Thiago Macieira --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 4 ++-- src/plugins/platforms/windows/qwindowsfontdatabase.cpp | 4 ++-- src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index f0770d7d188..7307d52cf9c 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -648,7 +648,7 @@ struct FindDialogContext HWND hwnd; // contains the HWND of the window found. }; -static BOOL CALLBACK findDialogEnumWindowsProc(HWND hwnd, LPARAM lParam) +static BOOL QT_WIN_CALLBACK findDialogEnumWindowsProc(HWND hwnd, LPARAM lParam) { FindDialogContext *context = reinterpret_cast(lParam); DWORD winPid = 0; @@ -1770,7 +1770,7 @@ void QWindowsXpNativeFileDialog::doExec(HWND owner) // Callback for QWindowsNativeXpFileDialog directory dialog. // MFC Directory Dialog. Contrib: Steve Williams (minor parts from Scott Powers) -static int CALLBACK xpFileDialogGetExistingDirCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) +static int QT_WIN_CALLBACK xpFileDialogGetExistingDirCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) { QWindowsXpNativeFileDialog *dialog = reinterpret_cast(lpData); return dialog->existingDirCallback(hwnd, uMsg, lParam); diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index fafdb377170..96659c505f8 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -933,8 +933,8 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet, return true; } -static int QT_ENSURE_STACK_ALIGNED_FOR_SSE CALLBACK -storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric, int type, LPARAM namesSetIn) +static int QT_WIN_CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric, + int type, LPARAM namesSetIn) { typedef QSet StringSet; const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName); diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index 57a9077e5dd..51961014d95 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -336,8 +336,8 @@ static QByteArray getFntTable(HFONT hfont, uint tag) } #endif -static int CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric, - int type, LPARAM namesSetIn) +static int QT_WIN_CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric, + int type, LPARAM namesSetIn) { typedef QSet StringSet; const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName)