From c430420840388749402061d3a82906dd4a654279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 10 Jun 2024 21:09:20 +0200 Subject: [PATCH] osdep/threads-win32: cast function type directly to avoid warnings --- osdep/threads-win32.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osdep/threads-win32.h b/osdep/threads-win32.h index e13e8a6f9b..72ab8ab315 100644 --- a/osdep/threads-win32.h +++ b/osdep/threads-win32.h @@ -188,12 +188,13 @@ static inline int mp_thread_detach(mp_thread thread) wchar_t *mp_from_utf8(void *talloc_ctx, const char *s); static inline void mp_thread_set_name(const char *name) { - HRESULT (WINAPI *pSetThreadDescription)(HANDLE, PCWSTR); + typedef HRESULT (WINAPI *SetThreadDescriptionFn)(HANDLE, PCWSTR); + SetThreadDescriptionFn pSetThreadDescription; #if !HAVE_UWP HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); if (!kernel32) return; - pSetThreadDescription = (void *) GetProcAddress(kernel32, "SetThreadDescription"); + pSetThreadDescription = (SetThreadDescriptionFn) GetProcAddress(kernel32, "SetThreadDescription"); if (!pSetThreadDescription) return; #else