Skip to content

Commit f045788

Browse files
committed
Add UWP patch from Kodi project.
1 parent 5bc5bfe commit f045788

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

msvc/contrib/dlfcn.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ void *dlopen(const char *module_name, int mode)
3636
* same path or can be found in the usual places. Failing that, let's
3737
* let that dso look in the apache root.
3838
*/
39+
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
3940
em = SetErrorMode(SEM_FAILCRITICALERRORS);
4041
dsoh = LoadLibraryExA(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
4142
if (!dsoh)
@@ -45,6 +46,11 @@ void *dlopen(const char *module_name, int mode)
4546
}
4647
SetErrorMode(em);
4748
SetLastError(0); // clear the last error
49+
#else
50+
wchar_t pathW[MAX_PATH];
51+
mbstowcs(pathW, path, MAX_PATH);
52+
dsoh = LoadPackagedLibrary(pathW, 0);
53+
#endif
4854
return (void *)dsoh;
4955
}
5056

src/dvd_reader.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
#include <stdio.h> /* fprintf */
3030
#include <errno.h> /* errno, EIN* */
3131
#include <string.h> /* memcpy, strlen */
32+
#if HAVE_UNISTD_H
3233
#include <unistd.h> /* pclose */
34+
#endif
3335
#include <limits.h> /* PATH_MAX */
3436
#include <dirent.h> /* opendir, readdir */
3537
#include <ctype.h> /* isalpha */
@@ -61,6 +63,7 @@
6163
#if defined(_WIN32)
6264
# include <windows.h>
6365
# include "msvc/contrib/win32_cs.h"
66+
# include <winsock2.h>
6467
# define strcasecmp _stricmp
6568
# define strncasecmp _strnicmp
6669
#endif

0 commit comments

Comments
 (0)