-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c7d154
commit 73248ab
Showing
11 changed files
with
683 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
gettext/gettext-0.22.5-gettext-runtime-gnulib-lib-localcharset-c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- origsrc/gettext-runtime/gnulib-lib/localcharset.c 2024-02-21 03:43:51.000000000 -0700 | ||
+++ src/gettext-runtime/gnulib-lib/localcharset.c 2024-02-26 07:33:50.105393100 -0700 | ||
@@ -51,10 +51,6 @@ | ||
# include <locale.h> | ||
# endif | ||
# endif | ||
-# ifdef __CYGWIN__ | ||
-# define WIN32_LEAN_AND_MEAN | ||
-# include <windows.h> | ||
-# endif | ||
#elif defined WINDOWS_NATIVE | ||
# define WIN32_LEAN_AND_MEAN | ||
# include <windows.h> | ||
@@ -351,7 +347,7 @@ static const struct table_entry alias_ta | ||
{ "646", "ASCII" } | ||
# define alias_table_defined | ||
# endif | ||
-# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Windows */ | ||
+# if defined WINDOWS_NATIVE /* Windows */ | ||
{ "CP1361", "JOHAB" }, | ||
{ "CP20127", "ASCII" }, | ||
{ "CP20866", "KOI8-R" }, | ||
@@ -846,68 +842,6 @@ locale_charset (void) | ||
/* Most systems support nl_langinfo (CODESET) nowadays. */ | ||
codeset = nl_langinfo (CODESET); | ||
|
||
-# ifdef __CYGWIN__ | ||
- /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always | ||
- returns "US-ASCII". Return the suffix of the locale name from the | ||
- environment variables (if present) or the codepage as a number. */ | ||
- if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) | ||
- { | ||
- const char *locale; | ||
- static char resultbuf[2 + 10 + 1]; | ||
- | ||
- locale = getenv ("LC_ALL"); | ||
- if (locale == NULL || locale[0] == '\0') | ||
- { | ||
- locale = getenv ("LC_CTYPE"); | ||
- if (locale == NULL || locale[0] == '\0') | ||
- locale = getenv ("LANG"); | ||
- } | ||
- if (locale != NULL && locale[0] != '\0') | ||
- { | ||
- /* If the locale name contains an encoding after the dot, return | ||
- it. */ | ||
- const char *dot = strchr (locale, '.'); | ||
- | ||
- if (dot != NULL) | ||
- { | ||
- const char *modifier; | ||
- | ||
- dot++; | ||
- /* Look for the possible @... trailer and remove it, if any. */ | ||
- modifier = strchr (dot, '@'); | ||
- if (modifier == NULL) | ||
- return dot; | ||
- if (modifier - dot < sizeof (resultbuf)) | ||
- { | ||
- /* This way of filling resultbuf is multithread-safe. */ | ||
- memcpy (resultbuf, dot, modifier - dot); | ||
- resultbuf [modifier - dot] = '\0'; | ||
- return resultbuf; | ||
- } | ||
- } | ||
- } | ||
- | ||
- /* The Windows API has a function returning the locale's codepage as a | ||
- number: GetACP(). This encoding is used by Cygwin, unless the user | ||
- has set the environment variable CYGWIN=codepage:oem (which very few | ||
- people do). | ||
- Output directed to console windows needs to be converted (to | ||
- GetOEMCP() if the console is using a raster font, or to | ||
- GetConsoleOutputCP() if it is using a TrueType font). Cygwin does | ||
- this conversion transparently (see winsup/cygwin/fhandler_console.cc), | ||
- converting to GetConsoleOutputCP(). This leads to correct results, | ||
- except when SetConsoleOutputCP has been called and a raster font is | ||
- in use. */ | ||
- { | ||
- char buf[2 + 10 + 1]; | ||
- | ||
- sprintf (buf, "CP%u", GetACP ()); | ||
- strcpy (resultbuf, buf); | ||
- codeset = resultbuf; | ||
- } | ||
- } | ||
-# endif | ||
- | ||
if (codeset == NULL) | ||
/* The canonical name cannot be determined. */ | ||
codeset = ""; |
11 changes: 11 additions & 0 deletions
11
gettext/gettext-0.22.5-gettext-runtime-gnulib-lib-localename-h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- origsrc/gettext-runtime/gnulib-lib/localename.h 2024-02-21 03:43:51.000000000 -0700 | ||
+++ src/gettext-runtime/gnulib-lib/localename.h 2024-02-26 07:40:54.664851300 -0700 | ||
@@ -91,7 +91,7 @@ extern const char * gl_locale_name_envir | ||
|
||
The result must not be freed; it is statically allocated. */ | ||
extern const char * gl_locale_name_default (void) | ||
-#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined _WIN32 || defined __CYGWIN__) | ||
+#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined _WIN32) | ||
_GL_ATTRIBUTE_CONST | ||
#endif | ||
; |
112 changes: 112 additions & 0 deletions
112
gettext/gettext-0.22.5-gettext-runtime-gnulib-lib-localename-unsafe-c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
--- origsrc/gettext-runtime/gnulib-lib/localename-unsafe.c 2024-02-21 03:43:51.000000000 -0700 | ||
+++ src/gettext-runtime/gnulib-lib/localename-unsafe.c 2024-02-25 09:16:19.293294900 -0700 | ||
@@ -77,7 +77,7 @@ extern char * getlocalename_l(int, local | ||
# include "thread-optim.h" | ||
#endif | ||
|
||
-#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ | ||
+#if defined WINDOWS_NATIVE /* Native Windows */ | ||
# define WIN32_LEAN_AND_MEAN | ||
# include <windows.h> | ||
# include <winnls.h> | ||
@@ -1461,7 +1461,7 @@ gl_locale_name_canonicalize (char *name) | ||
#endif | ||
|
||
|
||
-#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ | ||
+#if defined WINDOWS_NATIVE /* Native Windows */ | ||
|
||
/* Canonicalize a Windows native locale name to a Unix locale name. | ||
NAME is a sufficiently large buffer. | ||
@@ -3117,19 +3117,6 @@ gl_locale_name_thread_unsafe (int catego | ||
# endif | ||
# elif defined _AIX && HAVE_NAMELESS_LOCALES | ||
return get_locale_t_name (category, thread_locale); | ||
-# elif defined __CYGWIN__ | ||
- /* Cygwin < 2.6 lacks uselocale and thread-local locales altogether. | ||
- Cygwin <= 2.6.1 lacks NL_LOCALE_NAME, requiring peeking inside | ||
- an opaque struct. */ | ||
-# ifdef NL_LOCALE_NAME | ||
- return nl_langinfo_l (NL_LOCALE_NAME (category), thread_locale); | ||
-# else | ||
- /* FIXME: Remove when we can assume new-enough Cygwin. */ | ||
- struct __locale_t { | ||
- char categories[7][32]; | ||
- }; | ||
- return ((struct __locale_t *) thread_locale)->categories[category]; | ||
-# endif | ||
# elif defined __HAIKU__ | ||
/* Since 2022, Haiku has per-thread locales. locale_t is 'void *', | ||
but in fact a 'LocaleBackendData *'. */ | ||
@@ -3219,9 +3206,10 @@ gl_locale_name_thread_unsafe (int catego | ||
- musl libc, | ||
- FreeBSD, NetBSD, | ||
- Solaris, | ||
- - Haiku. | ||
+ - Haiku, | ||
+ - Cygwin. | ||
We cannot use it on | ||
- - macOS, Cygwin (because these systems have a facility for customizing the | ||
+ - macOS (because these systems have a facility for customizing the | ||
default locale, and setlocale (category, NULL) ignores it and merely | ||
returns "C" or "C.UTF-8"), | ||
- OpenBSD (because on OpenBSD ≤ 6.1, LC_ALL does not set the LC_NUMERIC, | ||
@@ -3232,7 +3220,7 @@ gl_locale_name_thread_unsafe (int catego | ||
- native Windows (because it has locale names such as French_France.1252), | ||
- Android (because it only supports the C and C.UTF-8 locales). | ||
*/ | ||
-#if defined _LIBC || ((defined __GLIBC__ && __GLIBC__ >= 2) && !defined __UCLIBC__) || MUSL_LIBC || defined __FreeBSD__ || defined __NetBSD__ || defined __sun || defined __HAIKU__ | ||
+#if defined _LIBC || ((defined __GLIBC__ && __GLIBC__ >= 2) && !defined __UCLIBC__) || MUSL_LIBC || defined __FreeBSD__ || defined __NetBSD__ || defined __sun || defined __HAIKU__ || defined CYGWIN | ||
# define HAVE_LOCALE_NULL | ||
#endif | ||
|
||
@@ -3273,8 +3261,8 @@ gl_locale_name_posix_unsafe (int categor | ||
/* On other systems we ignore what setlocale reports and instead look at the | ||
environment variables directly. This is necessary | ||
1. on systems which have a facility for customizing the default locale | ||
- (macOS, native Windows, Cygwin) and where the system's setlocale() | ||
- function ignores this default locale (macOS, Cygwin), in two cases: | ||
+ (macOS, native Windows) and where the system's setlocale() | ||
+ function ignores this default locale (macOS), in two cases: | ||
a. when the user missed to use the setlocale() override from libintl | ||
(for example by not including <libintl.h>), | ||
b. when setlocale supports only the "C" locale, such as on Cygwin | ||
@@ -3329,11 +3317,6 @@ gl_locale_name_environ (_GL_UNUSED int c | ||
Ignore invalid LANG value set by the Terminal application. */ | ||
if (strcmp (retval, "UTF-8") != 0) | ||
#endif | ||
-#if defined __CYGWIN__ | ||
- /* Cygwin. | ||
- Ignore dummy LANG value set by ~/.profile. */ | ||
- if (strcmp (retval, "C.UTF-8") != 0) | ||
-#endif | ||
return retval; | ||
} | ||
|
||
@@ -3362,16 +3345,11 @@ gl_locale_name_default (void) | ||
- On native Windows, by default, none of LC_* or LANG are set. | ||
When no environment variable is set, setlocale (LC_ALL, "") uses the | ||
locale chosen by the user. | ||
- - On Cygwin 1.5.x, by default, none of LC_* or LANG are set. | ||
- When no environment variable is set, setlocale (LC_ALL, "") uses the | ||
- "C" locale. | ||
- - On Cygwin 1.7, by default, LANG is set to "C.UTF-8" when the default | ||
- ~/.profile is executed. | ||
When no environment variable is set, setlocale (LC_ALL, "") uses the | ||
"C.UTF-8" locale, which operates in the same way as the "C" locale. | ||
*/ | ||
|
||
-#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE || defined __CYGWIN__) | ||
+#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE) | ||
|
||
/* The system does not have a way of setting the locale, other than the | ||
POSIX specified environment variables. We use C as default locale. */ | ||
@@ -3424,7 +3402,7 @@ gl_locale_name_default (void) | ||
|
||
# endif | ||
|
||
-# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ | ||
+# if defined WINDOWS_NATIVE /* Native Windows */ | ||
{ | ||
LCID lcid; | ||
|
91 changes: 91 additions & 0 deletions
91
gettext/gettext-0.22.5-gettext-runtime-intl-gnulib-lib-localcharset-c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- origsrc/gettext-runtime/intl/gnulib-lib/localcharset.c 2024-02-21 03:43:51.000000000 -0700 | ||
+++ src/gettext-runtime/intl/gnulib-lib/localcharset.c 2024-02-26 07:33:50.105393100 -0700 | ||
@@ -51,10 +51,6 @@ | ||
# include <locale.h> | ||
# endif | ||
# endif | ||
-# ifdef __CYGWIN__ | ||
-# define WIN32_LEAN_AND_MEAN | ||
-# include <windows.h> | ||
-# endif | ||
#elif defined WINDOWS_NATIVE | ||
# define WIN32_LEAN_AND_MEAN | ||
# include <windows.h> | ||
@@ -351,7 +347,7 @@ static const struct table_entry alias_ta | ||
{ "646", "ASCII" } | ||
# define alias_table_defined | ||
# endif | ||
-# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Windows */ | ||
+# if defined WINDOWS_NATIVE /* Windows */ | ||
{ "CP1361", "JOHAB" }, | ||
{ "CP20127", "ASCII" }, | ||
{ "CP20866", "KOI8-R" }, | ||
@@ -846,68 +842,6 @@ locale_charset (void) | ||
/* Most systems support nl_langinfo (CODESET) nowadays. */ | ||
codeset = nl_langinfo (CODESET); | ||
|
||
-# ifdef __CYGWIN__ | ||
- /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always | ||
- returns "US-ASCII". Return the suffix of the locale name from the | ||
- environment variables (if present) or the codepage as a number. */ | ||
- if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) | ||
- { | ||
- const char *locale; | ||
- static char resultbuf[2 + 10 + 1]; | ||
- | ||
- locale = getenv ("LC_ALL"); | ||
- if (locale == NULL || locale[0] == '\0') | ||
- { | ||
- locale = getenv ("LC_CTYPE"); | ||
- if (locale == NULL || locale[0] == '\0') | ||
- locale = getenv ("LANG"); | ||
- } | ||
- if (locale != NULL && locale[0] != '\0') | ||
- { | ||
- /* If the locale name contains an encoding after the dot, return | ||
- it. */ | ||
- const char *dot = strchr (locale, '.'); | ||
- | ||
- if (dot != NULL) | ||
- { | ||
- const char *modifier; | ||
- | ||
- dot++; | ||
- /* Look for the possible @... trailer and remove it, if any. */ | ||
- modifier = strchr (dot, '@'); | ||
- if (modifier == NULL) | ||
- return dot; | ||
- if (modifier - dot < sizeof (resultbuf)) | ||
- { | ||
- /* This way of filling resultbuf is multithread-safe. */ | ||
- memcpy (resultbuf, dot, modifier - dot); | ||
- resultbuf [modifier - dot] = '\0'; | ||
- return resultbuf; | ||
- } | ||
- } | ||
- } | ||
- | ||
- /* The Windows API has a function returning the locale's codepage as a | ||
- number: GetACP(). This encoding is used by Cygwin, unless the user | ||
- has set the environment variable CYGWIN=codepage:oem (which very few | ||
- people do). | ||
- Output directed to console windows needs to be converted (to | ||
- GetOEMCP() if the console is using a raster font, or to | ||
- GetConsoleOutputCP() if it is using a TrueType font). Cygwin does | ||
- this conversion transparently (see winsup/cygwin/fhandler_console.cc), | ||
- converting to GetConsoleOutputCP(). This leads to correct results, | ||
- except when SetConsoleOutputCP has been called and a raster font is | ||
- in use. */ | ||
- { | ||
- char buf[2 + 10 + 1]; | ||
- | ||
- sprintf (buf, "CP%u", GetACP ()); | ||
- strcpy (resultbuf, buf); | ||
- codeset = resultbuf; | ||
- } | ||
- } | ||
-# endif | ||
- | ||
if (codeset == NULL) | ||
/* The canonical name cannot be determined. */ | ||
codeset = ""; |
Oops, something went wrong.