This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] [C++/mingw] gdb-dlfcn.c casts


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2986367f8eea0dc5febab9c9fd1cf06b3a4a8fdb

commit 2986367f8eea0dc5febab9c9fd1cf06b3a4a8fdb
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Nov 17 15:17:44 2015 +0000

    [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  <palves@redhat.com>
    
    	* gdb-dlfcn.c (gdb_dlsym, gdb_dlclose) [__MINGW32__]: Add casts to
    	HMODULE.

Diff:
---
 gdb/ChangeLog   | 5 +++++
 gdb/gdb-dlfcn.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6549bad..a3bc676 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2015-11-17  Pedro Alves  <palves@redhat.com>
 
+	* gdb-dlfcn.c (gdb_dlsym, gdb_dlclose) [__MINGW32__]: Add casts to
+	HMODULE.
+
+2015-11-17  Pedro Alves  <palves@redhat.com>
+
 	* exec.c (exec_file_attach, symfile_bfd_open) [__GO32__ || _WIN32
 	|| __CYGWIN__]: Add casts.
 	* utils.c (gdb_filename_fnmatch): Add cast.
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
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]