aboutsummaryrefslogtreecommitdiff
path: root/ports/libiconv/0003-Fix-uwp.patch
blob: 0b2444166e298a5f40f29821939ebc3b063a0204 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;