Commit 02285482 by Vicent Marti

fileops: Cast the GetProcAddress value

parent 9c11bd0a
...@@ -689,7 +689,8 @@ int gitfo_lstat__w32(const char *file_name, struct stat *buf) ...@@ -689,7 +689,8 @@ int gitfo_lstat__w32(const char *file_name, struct stat *buf)
int gitfo_readlink__w32(const char *link, char *target, size_t target_len) int gitfo_readlink__w32(const char *link, char *target, size_t target_len)
{ {
static DWORD (*pGetFinalPath)(HANDLE, LPTSTR, DWORD, DWORD) = NULL; typedef DWORD (WINAPI *fpath_func)(HANDLE, LPTSTR, DWORD, DWORD);
static fpath_func pGetFinalPath = NULL;
HANDLE hFile; HANDLE hFile;
DWORD dwRet; DWORD dwRet;
...@@ -698,10 +699,10 @@ int gitfo_readlink__w32(const char *link, char *target, size_t target_len) ...@@ -698,10 +699,10 @@ int gitfo_readlink__w32(const char *link, char *target, size_t target_len)
* it is not available in platforms older than Vista * it is not available in platforms older than Vista
*/ */
if (pGetFinalPath == NULL) { if (pGetFinalPath == NULL) {
HANDLE library = LoadLibrary("kernel32"); HINSTANCE library = LoadLibrary("kernel32");
if (library != NULL) if (library != NULL)
pGetFinalPath = GetProcAddress(library, "GetFinalPathNameByHandleA"); pGetFinalPath = (fpath_func)GetProcAddress(library, "GetFinalPathNameByHandleA");
if (pGetFinalPath == NULL) if (pGetFinalPath == NULL)
return git__throw(GIT_EOSERR, return git__throw(GIT_EOSERR,
......
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