vcpkg/ports/gettext/uwp.patch
Kai Pastor 6b3a1a2188
[gettext] Update to 0.21.1 (#29113)
* Use VERSION

* Update to 0.21.1

* Update win unicode paths patch

* Revise uwp patches

* Cleanup

* Build tools for uwp in CI

* tools not supported on uwp

* Add license GPL3.0-or-later.

gettext.c has:

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

* Fix license, but better.

* Version database

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2023-01-27 07:25:29 -08:00

73 lines
2.1 KiB
Diff

diff --git a/gettext-runtime/gnulib-lib/fcntl.c b/gettext-runtime/gnulib-lib/fcntl.c
index f9753c4..3a3caee 100644
--- a/gettext-runtime/gnulib-lib/fcntl.c
+++ b/gettext-runtime/gnulib-lib/fcntl.c
@@ -38,6 +38,12 @@
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+# if defined(WINAPI_FAMILY_PARTITION)
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+# define HANDLE_FLAG_INHERIT 0
+# endif
+# endif
+
/* Get _get_osfhandle. */
# if GNULIB_MSVC_NOTHROW
# include "msvc-nothrow.h"
diff --git a/gettext-runtime/intl/langprefs.c b/gettext-runtime/intl/langprefs.c
index f774ba2..f488b7f 100644
--- a/gettext-runtime/intl/langprefs.c
+++ b/gettext-runtime/intl/langprefs.c
@@ -38,6 +38,11 @@ extern void _nl_locale_name_canonicalize (char *name);
#if defined _WIN32
# define WIN32_NATIVE
+# if defined(WINAPI_FAMILY_PARTITION)
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+# undef WIN32_NATIVE
+# endif
+# endif
#endif
#ifdef WIN32_NATIVE
diff --git a/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c
index ec75427..9e063e4 100644
--- a/gettext-runtime/intl/localcharset.c
+++ b/gettext-runtime/intl/localcharset.c
@@ -34,6 +34,9 @@
#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
# include <locale.h>
+# if !defined(WINAPI_FAMILY_PARTITION)
+# define WINAPI_FAMILY_PARTITION(x) (0)
+# endif
#endif
#if defined __EMX__
@@ -912,6 +915,8 @@ locale_charset (void)
/* The canonical name cannot be determined. */
codeset = "";
+# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ codeset = "";
# elif defined WINDOWS_NATIVE
char buf[2 + 10 + 1];
diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c
index d77bb81..3c6e055 100644
--- a/gettext-runtime/intl/localename.c
+++ b/gettext-runtime/intl/localename.c
@@ -69,6 +69,11 @@ extern char * getlocalename_l(int, locale_t);
#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
+# if defined(WINAPI_FAMILY_PARTITION)
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+# undef WIN32_NATIVE
+# endif
+# endif
# if !defined IN_LIBINTL
# include "glthread/lock.h"
# endif