fix for uwp builds

This commit is contained in:
Dale Stammen 2016-11-28 13:01:55 -08:00
parent 1edc7e0d3b
commit 8ee0ec1699
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,25 @@
diff --git a/libcharset/lib/localcharset.c b/libcharset/lib/localcharset.c
index 3aceb42..dadd95a 100644
--- a/libcharset/lib/localcharset.c
+++ b/libcharset/lib/localcharset.c
@@ -455,7 +455,10 @@ locale_charset (void)
# endif
#elif defined WIN32_NATIVE
-
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+ // GetACP() not available to UWP apps
+ codeset = NULL;
+#else
static char buf[2 + 10 + 1];
/* Woe32 has a function returning the locale's codepage as a number:
@@ -467,7 +470,7 @@ locale_charset (void)
encoding is the best bet. */
sprintf (buf, "CP%u", GetACP ());
codeset = buf;
-
+#endif
#elif defined OS2
const char *locale;

View File

@ -55,6 +55,8 @@ list(APPEND Libiconv_headers ${Libiconv_BINARY_DIR}/localcharset.h)
#
set(libname libiconv)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
configure_file(
${Libiconv_SOURCE_DIR}/include/iconv.h.build.in
${Libiconv_BINARY_DIR}/iconv.h

View File

@ -14,6 +14,7 @@ vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Add-export-definitions.patch
${CMAKE_CURRENT_LIST_DIR}/0002-Config-for-MSVC.patch
${CMAKE_CURRENT_LIST_DIR}/0003-Fix-uwp.patch
)
vcpkg_configure_cmake(