diff options
author | Werner Koch <wk@gnupg.org> | 2022-06-03 11:11:28 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2022-06-03 11:11:28 +0200 |
commit | 59c481bb86464953e526298bfe73c3466387c46d (patch) | |
tree | 799ba332e03a0a6fd20610a6b689395139599a8c | |
parent | w32: Allow Unicode filenames for iobuf_cancel. (diff) | |
download | gnupg2-59c481bb86464953e526298bfe73c3466387c46d.tar.xz gnupg2-59c481bb86464953e526298bfe73c3466387c46d.zip |
common,w32: Use LoadLibraryEx to fix a warning in mingw.
* common/dynload.h (dlopen): Use LoadLibraryEx and remove Windows CE
support.
--
Mingw's libloadapi.h has no prototype for LoadLibrary. Thus we use
LoadLibraryEx which is available Since Windows XP.
-rw-r--r-- | common/dynload.h | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/common/dynload.h b/common/dynload.h index f6ec8753b..6ac7b4e17 100644 --- a/common/dynload.h +++ b/common/dynload.h @@ -45,14 +45,9 @@ static inline void * dlopen (const char *name, int flag) { void *hd; -#ifdef HAVE_W32CE_SYSTEM - wchar_t *wname = utf8_to_wchar (name); - hd = wname? LoadLibrary (wname) : NULL; - xfree (wname); -#else - hd = LoadLibrary (name); -#endif (void)flag; + + hd = LoadLibraryEx (name, NULL, 0); return hd; } @@ -61,13 +56,7 @@ dlsym (void *hd, const char *sym) { if (hd && sym) { -#ifdef HAVE_W32CE_SYSTEM - wchar_t *wsym = utf8_to_wchar (sym); - void *fnc = wsym? GetProcAddress (hd, wsym) : NULL; - xfree (wsym); -#else void *fnc = GetProcAddress (hd, sym); -#endif if (!fnc) return NULL; return fnc; |