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.
This commit is contained in:
Werner Koch 2022-06-03 11:11:28 +02:00
parent 4ee2009083
commit 59c481bb86
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 2 additions and 13 deletions

View File

@ -45,14 +45,9 @@ static inline void *
dlopen (const char *name, int flag) dlopen (const char *name, int flag)
{ {
void *hd; 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; (void)flag;
hd = LoadLibraryEx (name, NULL, 0);
return hd; return hd;
} }
@ -61,13 +56,7 @@ dlsym (void *hd, const char *sym)
{ {
if (hd && 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); void *fnc = GetProcAddress (hd, sym);
#endif
if (!fnc) if (!fnc)
return NULL; return NULL;
return fnc; return fnc;