--- 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 # include @@ -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 ), 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;