hidapi: fixed upstream build

This commit is contained in:
Sam Lantinga 2023-05-27 08:21:59 -07:00
parent bc28790817
commit 2666e15cf1
1 changed files with 8 additions and 1 deletions

View File

@ -1370,8 +1370,15 @@ int HID_API_EXPORT HID_API_CALL hid_get_input_report(hid_device *dev, unsigned c
void HID_API_EXPORT HID_API_CALL hid_close(hid_device *dev)
{
#if defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
typedef BOOL (WINAPI *CancelIoEx_t)(HANDLE hFile, LPOVERLAPPED lpOverlapped);
CancelIoEx_t CancelIoExFunc = (CancelIoEx_t)(void *)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "CancelIoEx");
CancelIoEx_t CancelIoExFunc = (CancelIoEx_t)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "CancelIoEx");
#if defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
if (!dev)
return;