Skip to content

Commit

Permalink
Windows: Add a missing WINAPI for a callback function
Browse files Browse the repository at this point in the history
This fixes compilation for i686 after
5feefd3, fixing compilation errors
like these:

    qtbase/src/plugins/platforms/windows/qwindowswindow.cpp:901:69: error: no matching member function for call to 'registerWindowClass'
      901 |     const QString windowTitlebarName = QWindowsContext::instance()->registerWindowClass(QStringLiteral("_q_titlebar"), WndProcTitleBar, CS_VREDRAW|CS_HREDRAW, nullptr, false);
          |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
    qtbase/src/plugins/platforms/windows/qwindowscontext.h:77:13: note: candidate function not viable: no known conversion from 'LRESULT (HWND, UINT, WPARAM, LPARAM)' (aka 'long (HWND__ *, unsigned int, unsigned int, long)') to 'WNDPROC' (aka 'long (*)(HWND__ *, unsigned int, unsigned int, long) __attribute__((stdcall))') for 2nd argument
       77 |     QString registerWindowClass(QString cname, WNDPROC proc,
          |             ^                                  ~~~~~~~~~~~~

Change-Id: I9eb2d3dc0626b8606d4b49cf82fba34d6a4b2942
Reviewed-by: Tor Arne Vestbø <[email protected]>
  • Loading branch information
mstorsjo committed Nov 28, 2024
1 parent aec007d commit fbd8067
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/platforms/windows/qwindowswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static inline RECT RECTfromQRect(const QRect &rect)
return result;
}

static LRESULT WndProcTitleBar(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static LRESULT WINAPI WndProcTitleBar(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND parentHwnd = reinterpret_cast<HWND>(GetWindowLongPtr(hwnd, GWL_HWNDPARENT));
QWindowsWindow* platformWindow = QWindowsContext::instance()->findPlatformWindow(parentHwnd);
Expand Down

0 comments on commit fbd8067

Please sign in to comment.