Warning, /graphics/krita/3rdparty/ext_gettext/0002-Fix-uwp-build.patch is written in an unsupported language. File is not indexed.

0001 From 01bc26c9b77c54544fc25184b1b229894f83d9fc Mon Sep 17 00:00:00 2001
0002 From: "L. E. Segovia" <amy@amyspark.me>
0003 Date: Sat, 20 Feb 2021 20:04:21 +0000
0004 Subject: [PATCH 2/4] Fix uwp build
0005 
0006 ---
0007  gettext-runtime/intl/langprefs.c    | 10 ++++++++--
0008  gettext-runtime/intl/localcharset.c | 14 ++++++++++++--
0009  gettext-runtime/intl/localename.c   | 10 ++++++++--
0010  3 files changed, 28 insertions(+), 6 deletions(-)
0011 
0012 diff --git a/gettext-runtime/intl/langprefs.c b/gettext-runtime/intl/langprefs.c
0013 index f774ba2..498933a 100644
0014 --- a/gettext-runtime/intl/langprefs.c
0015 +++ b/gettext-runtime/intl/langprefs.c
0016 @@ -36,8 +36,14 @@
0017  extern void _nl_locale_name_canonicalize (char *name);
0018  #endif
0019  
0020 -#if defined _WIN32
0021 -# define WIN32_NATIVE
0022 +#if defined _WIN32 || defined __WIN32__
0023 +# if !defined(WINAPI_FAMILY)
0024 +#      define WIN32_NATIVE
0025 +# else
0026 +#      if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
0027 +#              define WIN32_NATIVE
0028 +#   endif
0029 +# endif
0030  #endif
0031  
0032  #ifdef WIN32_NATIVE
0033 diff --git a/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c
0034 index ec75427..3028bc2 100644
0035 --- a/gettext-runtime/intl/localcharset.c
0036 +++ b/gettext-runtime/intl/localcharset.c
0037 @@ -36,6 +36,16 @@
0038  # include <locale.h>
0039  #endif
0040  
0041 +#if defined _WIN32 || defined __WIN32__
0042 +# if !defined(WINAPI_FAMILY)
0043 +#      define HAVE_ACP
0044 +# else
0045 +#      if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
0046 +#              define HAVE_ACP
0047 +#   endif
0048 +# endif
0049 +#endif
0050 +
0051  #if defined __EMX__
0052  /* Assume EMX program runs on OS/2, even if compiled under DOS.  */
0053  # ifndef OS2
0054 @@ -830,7 +840,7 @@ STATIC
0055  const char *
0056  locale_charset (void)
0057  {
0058 -  const char *codeset;
0059 +  const char *codeset = NULL;
0060  
0061    /* This function must be multithread-safe.  To achieve this without using
0062       thread-local storage, we use a simple strcpy or memcpy to fill this static
0063 @@ -912,7 +922,7 @@ locale_charset (void)
0064      /* The canonical name cannot be determined.  */
0065      codeset = "";
0066  
0067 -# elif defined WINDOWS_NATIVE
0068 +# elif defined WINDOWS_NATIVE && defined HAVE_ACP
0069  
0070    char buf[2 + 10 + 1];
0071    static char resultbuf[2 + 10 + 1];
0072 diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c
0073 index 6458f75..a3845a4 100644
0074 --- a/gettext-runtime/intl/localename.c
0075 +++ b/gettext-runtime/intl/localename.c
0076 @@ -72,8 +72,14 @@ extern char * getlocalename_l(int, locale_t);
0077  # include <CoreFoundation/CFPreferences.h>
0078  #endif
0079  
0080 -#if defined _WIN32 && !defined __CYGWIN__
0081 -# define WINDOWS_NATIVE
0082 +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
0083 +# if !defined(WINAPI_FAMILY)
0084 +#      define WINDOWS_NATIVE
0085 +# else
0086 +#      if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
0087 +#              define WINDOWS_NATIVE
0088 +#   endif
0089 +# endif
0090  # if !defined IN_LIBINTL
0091  #  include "glthread/lock.h"
0092  # endif
0093 -- 
0094 2.31.1.windows.1
0095