--- origsrc/glib-2.83.4/glib/libcharset/localcharset.c 2025-02-20 21:37:13.000000000 +0900 +++ src/glib-2.83.4/glib/libcharset/localcharset.c 2025-02-23 17:22:31.560707700 +0900 @@ -46,10 +46,6 @@ # include # endif # endif -# ifdef __CYGWIN__ -# define WIN32_LEAN_AND_MEAN -# include -# endif #elif defined WIN32_NATIVE # define WIN32_LEAN_AND_MEAN # include @@ -111,7 +107,7 @@ _g_locale_get_charset_aliases (void) cp = charset_aliases; if (cp == NULL) { -#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) +#if !(defined VMS || defined WIN32_NATIVE) FILE *fp; const char *dir; const char *base = "charset.alias"; @@ -233,7 +229,7 @@ _g_locale_get_charset_aliases (void) "DECKOREAN" "\0" "EUC-KR" "\0"; # endif -# if defined WIN32_NATIVE || defined __CYGWIN__ +# if defined WIN32_NATIVE /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ @@ -288,53 +284,6 @@ _g_locale_charset_raw (void) /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); -# ifdef __CYGWIN__ - /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always - returns "US-ASCII". As long as this is not fixed, 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 buf[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 (buf)) - { - memcpy (buf, dot, modifier - dot); - buf [modifier - dot] = '\0'; - return buf; - } - } - } - - /* Woe32 has a function returning the locale's codepage as a number. */ - sprintf (buf, "CP%u", GetACP ()); - codeset = buf; - } -# endif - # else /* On old systems which lack it, use setlocale or getenv. */