[03/11,C++/mingw] gdb-dlfcn.c casts

Message ID 1446492970-21432-4-git-send-email-palves@redhat.com
State New, archived
Headers

Commit Message

Pedro Alves Nov. 2, 2015, 7:36 p.m. UTC
  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-01  Pedro Alves  <palves@redhat.com>

	* gdb-dlfcn.c (gdb_dlsym, gdb_dlclose) [__MINGW32__]: Add casts to
	HMODULE.
---
 gdb/gdb-dlfcn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/gdb-dlfcn.c b/gdb/gdb-dlfcn.c
index fb6dc5f..fbd3a49 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
 }