aboutsummaryrefslogtreecommitdiff
path: root/ports/gettext/0002-Fix-uwp-build.patch
blob: ba98e2665d5d4f51b8476a38cfc3817739085b13 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
diff --git "a/gettext-runtime/intl/langprefs.c" "b/gettext-runtime/intl/langprefs.c"
index aeb1c4e9..2ac531be 100644
--- "a/gettext-runtime/intl/langprefs.c"
+++ "b/gettext-runtime/intl/langprefs.c"
@@ -33,7 +33,13 @@ extern void _nl_locale_name_canonicalize (char *name);
 #endif
 
 #if defined _WIN32
-# define WIN32_NATIVE
+# if !defined(WINAPI_FAMILY)
+#	define WIN32_NATIVE
+# else
+#	if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+#		define WIN32_NATIVE
+#   endif
+# endif
 #endif
 
 #ifdef WIN32_NATIVE
diff --git "a/gettext-runtime/intl/localcharset.c" "b/gettext-runtime/intl/localcharset.c"
index 670b8e6c..035a96bd 100644
--- "a/gettext-runtime/intl/localcharset.c"
+++ "b/gettext-runtime/intl/localcharset.c"
@@ -36,6 +36,16 @@
 # include <locale.h>
 #endif
 
+#if defined _WIN32
+# if !defined(WINAPI_FAMILY)
+#	define HAVE_ACP
+# else
+#	if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+#		define HAVE_ACP
+#   endif
+# endif
+#endif
+
 #if defined __EMX__
 /* Assume EMX program runs on OS/2, even if compiled under DOS.  */
 # ifndef OS2
@@ -830,7 +830,7 @@ STATIC
 const char *
 locale_charset (void)
 {
-  const char *codeset;
+  const char *codeset = NULL;
 
   /* This function must be multithread-safe.  To achieve this without using
      thread-local storage, we use a simple strcpy or memcpy to fill this static
@@ -912,7 +912,7 @@ locale_charset (void)
     /* The canonical name cannot be determined.  */
     codeset = "";
 
-# elif defined WINDOWS_NATIVE
+# elif defined WINDOWS_NATIVE && defined HAVE_ACP
 
   char buf[2 + 10 + 1];
   static char resultbuf[2 + 10 + 1];
diff --git "a/gettext-runtime/intl/localename.c" "b/gettext-runtime/intl/localename.c"
index 108dd6f1..ace3aa88 100644
--- "a/gettext-runtime/intl/localename.c"
+++ "b/gettext-runtime/intl/localename.c"
@@ -75,10 +75,16 @@
 #endif
 
 #if defined _WIN32 && !defined __CYGWIN__
-# define WINDOWS_NATIVE
+# if !defined(WINAPI_FAMILY)
+#	define WINDOWS_NATIVE
+# else
+#	if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+#		define WINDOWS_NATIVE
+#   endif
+# endif
 # if !defined IN_LIBINTL
 #  include "glthread/lock.h"
 # endif
 #endif
 
 #if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */