diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-06-17 19:19:30 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-06-17 19:19:30 +0200 |
| commit | 02285482f18250c33e3d0780cafc6d48346935f3 (patch) | |
| tree | fb3cbefdaa17ab253303da3c5d24cf6402ef6829 /src/fileops.c | |
| parent | 9c11bd0a060f96c9724418074f5cefd1e26ec2db (diff) | |
| download | libgit2-02285482f18250c33e3d0780cafc6d48346935f3.tar.gz | |
fileops: Cast the GetProcAddress value
Diffstat (limited to 'src/fileops.c')
| -rw-r--r-- | src/fileops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fileops.c b/src/fileops.c index 12b28bf02..d9c0aa003 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -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) { - static DWORD (*pGetFinalPath)(HANDLE, LPTSTR, DWORD, DWORD) = NULL; + typedef DWORD (WINAPI *fpath_func)(HANDLE, LPTSTR, DWORD, DWORD); + static fpath_func pGetFinalPath = NULL; HANDLE hFile; DWORD dwRet; @@ -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 */ if (pGetFinalPath == NULL) { - HANDLE library = LoadLibrary("kernel32"); + HINSTANCE library = LoadLibrary("kernel32"); if (library != NULL) - pGetFinalPath = GetProcAddress(library, "GetFinalPathNameByHandleA"); + pGetFinalPath = (fpath_func)GetProcAddress(library, "GetFinalPathNameByHandleA"); if (pGetFinalPath == NULL) return git__throw(GIT_EOSERR, |
