From 2986367f8eea0dc5febab9c9fd1cf06b3a4a8fdb Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 17 Nov 2015 15:17:44 +0000 Subject: [PATCH] [C++/mingw] gdb-dlfcn.c casts Fixes: ../../src/gdb/gdb-dlfcn.c: In function 'void* gdb_dlsym(void*, const char*)': ../../src/gdb/gdb-dlfcn.c:105:49: error: invalid conversion from 'void*' to 'HMODULE {aka HINSTANCE__*}' [-fpermissive] return (void *) GetProcAddress (handle, symbol); ^ gdb/ChangeLog: 2015-11-17 Pedro Alves * gdb-dlfcn.c (gdb_dlsym, gdb_dlclose) [__MINGW32__]: Add casts to HMODULE. --- gdb/ChangeLog | 5 +++++ gdb/gdb-dlfcn.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6549badec1d..a3bc676af76 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-11-17 Pedro Alves + + * gdb-dlfcn.c (gdb_dlsym, gdb_dlclose) [__MINGW32__]: Add casts to + HMODULE. + 2015-11-17 Pedro Alves * exec.c (exec_file_attach, symfile_bfd_open) [__GO32__ || _WIN32 diff --git a/gdb/gdb-dlfcn.c b/gdb/gdb-dlfcn.c index fb6dc5fd595..fbd3a499008 100644 --- a/gdb/gdb-dlfcn.c +++ b/gdb/gdb-dlfcn.c @@ -102,7 +102,7 @@ gdb_dlsym (void *handle, const char *symbol) #ifdef HAVE_DLFCN_H return dlsym (handle, symbol); #elif __MINGW32__ - return (void *) GetProcAddress (handle, symbol); + return (void *) GetProcAddress ((HMODULE) handle, symbol); #endif } @@ -112,7 +112,7 @@ gdb_dlclose (void *handle) #ifdef HAVE_DLFCN_H return dlclose (handle); #elif __MINGW32__ - return !((int) FreeLibrary (handle)); + return !((int) FreeLibrary ((HMODULE) handle)); #endif } -- 2.30.2