Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow direct cast of
get_proc_address
result (#95)
GetProcAddress returns a pointer to some function. It can return pointers to different functions, so it has to return something that is suitable to store any pointer to function. Microsoft chose FARPROC, which is int (WINAPI *)() on 32-bit Windows. The user is supposed to know the signature of the function he requests and perform a cast (which is a nop on this platform). The result is a pointer to function with the required signature, which is bitwise equal to what GetProcAddress returned. However, gcc >= 8 warns about that. Add an overload with a template parameter to do the cast inside the function and suppress the warning there.
- Loading branch information