summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-06-03 11:11:28 +0200
committerWerner Koch <wk@gnupg.org>2022-06-03 11:11:28 +0200
commit59c481bb86464953e526298bfe73c3466387c46d (patch)
tree799ba332e03a0a6fd20610a6b689395139599a8c /common
parentw32: Allow Unicode filenames for iobuf_cancel. (diff)
downloadgnupg2-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.
Diffstat (limited to 'common')
-rw-r--r--common/dynload.h15
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;