Commit 759ec7d4 by Edward Thomson

win32: cast GetProcAddress to void * before casting

GetProcAddress is prototyped to return a `FARPROC`, which is meant to be
a generic function pointer.  It's literally `int (FAR WINAPI * FARPROC)()`
which gcc complains if you attempt to cast to a `void (*)(GIT_SRWLOCK *)`.
Cast to a `void *` before casting to avoid warnings about the arguments.
parent 3cd123e9
......@@ -42,15 +42,15 @@ int git_threads_init(void)
HMODULE hModule = GetModuleHandleW(L"kernel32");
if (hModule) {
win32_srwlock_initialize = (win32_srwlock_fn)
win32_srwlock_initialize = (win32_srwlock_fn)(void *)
GetProcAddress(hModule, "InitializeSRWLock");
win32_srwlock_acquire_shared = (win32_srwlock_fn)
win32_srwlock_acquire_shared = (win32_srwlock_fn)(void *)
GetProcAddress(hModule, "AcquireSRWLockShared");
win32_srwlock_release_shared = (win32_srwlock_fn)
win32_srwlock_release_shared = (win32_srwlock_fn)(void *)
GetProcAddress(hModule, "ReleaseSRWLockShared");
win32_srwlock_acquire_exclusive = (win32_srwlock_fn)
win32_srwlock_acquire_exclusive = (win32_srwlock_fn)(void *)
GetProcAddress(hModule, "AcquireSRWLockExclusive");
win32_srwlock_release_exclusive = (win32_srwlock_fn)
win32_srwlock_release_exclusive = (win32_srwlock_fn)(void *)
GetProcAddress(hModule, "ReleaseSRWLockExclusive");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment