Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[win10] update libxml2 uwp patch #111

Merged
merged 1 commit into from
Oct 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 29 additions & 12 deletions depends/windowsstore/libxml2/02-fix-uwp-api.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 913da3e..07cbec1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -147,7 +147,12 @@ target_include_directories(
target_compile_definitions(libxml2
PRIVATE
_CRT_SECURE_NO_WARNINGS
- _CRT_STDC_NO_DEPRECATE)
+ _CRT_SECURE_NO_DEPRECATE
+ _CRT_STDC_NO_DEPRECATE
+ _CRT_NONSTDC_NO_DEPRECATE
+ HAVE_WIN32_THREADS
+ _WINSOCK_DEPRECATED_NO_WARNINGS
+)

if(BUILD_SHARED_LIBS AND MSVC)
target_link_libraries(libxml2 PRIVATE ws2_32.lib)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afedchin applying this hunk of the patch fails. I've no idea where you got that from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked well 3 months ago. What was changed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it never applied. Before xbmc/xbmc#15321 failing patches were just ignored.

diff --git a/catalog.c b/catalog.c
index 6dfdfbb..a5655f0 100644
--- a/catalog.c
Expand Down Expand Up @@ -107,19 +125,15 @@ index 1a79c09..9d8bd15 100644
xmlWrapStat = xmlWrapStatUtf8;
xmlWrapOpen = xmlWrapOpenUtf8;
#ifdef HAVE_ZLIB_H
@@ -3841,10 +3849,12 @@ xmlParserGetDirectory(const char *filename) {
@@ -3841,7 +3849,7 @@ xmlParserGetDirectory(const char *filename) {
else *cur = 0;
ret = xmlMemStrdup(dir);
} else {
+#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
if (getcwd(dir, 1024) != NULL) {
dir[1023] = 0;
ret = xmlMemStrdup(dir);
}
+#endif
}
return(ret);
#undef IS_XMLPGD_SEP
- if (getcwd(dir, 1024) != NULL) {
+ if (_getcwd(dir, 1024) != NULL) {
dir[1023] = 0;
ret = xmlMemStrdup(dir);
}
diff --git a/xmlmemory.c b/xmlmemory.c
index f08c8c3..8b9c35e 100644
--- a/xmlmemory.c
Expand All @@ -139,15 +153,18 @@ diff --git a/xmlmodule.c b/xmlmodule.c
index 50ed666..be21bcc 100644
--- a/xmlmodule.c
+++ b/xmlmodule.c
@@ -308,7 +308,11 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
@@ -308,7 +308,14 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
static void *
xmlModulePlatformOpen(const char *name)
{
- return LoadLibraryA(name);
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
+ return LoadLibraryA(name);
+#else
+ return LoadPackagedLibrary(name, 0);
+ wchar_t* nameW = (wchar_t*)malloc(strlen(name)+1);
+ mbstowcs(nameW, name, strlen(name));
+ return LoadPackagedLibrary(nameW, 0);
+ free(nameW);
+#endif
}

Expand Down