0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00

osdep/threads-win32: cast function type directly to avoid warnings

This commit is contained in:
Kacper Michajłow 2024-06-10 21:09:20 +02:00
parent ab3d0b73f7
commit c430420840

View File

@ -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