Skip to content

usb-backend: Fix compiling with i686 clang in mingw

Biswapriyo Nath requested to merge (removed):fix-clang32 into master
This adds the stdcall attribute to match the function prototype which
is used with SetWindowSubclass Win32 API. Otherwise, clang 16 targeting
i686-w64-windows-gnu shows the following compiler error:

../src/usb-backend.c:269:38: error: incompatible function pointer types passing
'LRESULT (HWND, UINT, WPARAM, LPARAM, UINT_PTR, DWORD_PTR)' (aka 'long (struct HWND__ *, unsigned int, unsigned int, long, unsigned int, unsigned long)') to parameter of type
'SUBCLASSPROC' (aka 'long (*)(structHWND__ *, unsigned int, unsigned int, long, unsigned int, unsigned long) __attribute__((stdcall))') [-Wincompatible-function-pointer-types]
    if (!SetWindowSubclass(be->hWnd, subclass_proc, 0, (DWORD_PTR)be)) {
                                     ^~~~~~~~~~~~~

Merge request reports