vcpkg/ports/libiconv/0003-Fix-uwp.patch

26 lines
697 B
Diff
Raw Normal View History

2016-11-29 05:01:55 +08:00
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;