From: Bruno Haible Date: Mon, 9 Mar 2026 13:10:43 +0000 (+0100) Subject: c32tolower, c32toupper: Fix for Turkish locale in Cygwin 3.6.7. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce596a4aa55bee4c3ebdcb8dc0cdfda88f601e2c;p=thirdparty%2Fgnulib.git c32tolower, c32toupper: Fix for Turkish locale in Cygwin 3.6.7. * lib/c32to-impl.h (FUNC): Move _GL_SMALL_WCHAR_T case up. --- diff --git a/ChangeLog b/ChangeLog index 3ec0fee6b1..0d5cbd1672 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2026-03-09 Bruno Haible + + c32tolower, c32toupper: Fix for Turkish locale in Cygwin 3.6.7. + * lib/c32to-impl.h (FUNC): Move _GL_SMALL_WCHAR_T case up. + 2026-03-09 Bruno Haible doc: Document C2y stdc_* functions. diff --git a/lib/c32to-impl.h b/lib/c32to-impl.h index f6eaf5fdb4..b89cc98e2d 100644 --- a/lib/c32to-impl.h +++ b/lib/c32to-impl.h @@ -53,22 +53,6 @@ FUNC (wint_t wc) else return wc; -#elif HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB /* glibc, Android */ - /* mbrtoc32() is essentially defined by the system libc. */ - -# if _GL_WCHAR_T_IS_UCS4 - /* The char32_t encoding of a multibyte character is known to be the same as - the wchar_t encoding. */ - return WCHAR_FUNC (wc); -# else - /* The char32_t encoding of a multibyte character is known to be UCS-4, - different from the wchar_t encoding. */ - if (wc != WEOF) - return UCS_FUNC (wc); - else - return wc; -# endif - #elif _GL_SMALL_WCHAR_T /* Cygwin, mingw, MSVC */ /* The wchar_t encoding is UTF-16. The char32_t encoding is UCS-4. */ @@ -90,6 +74,22 @@ FUNC (wint_t wc) return UCS_FUNC (wc); # endif +#elif HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB /* glibc, Android */ + /* mbrtoc32() is essentially defined by the system libc. */ + +# if _GL_WCHAR_T_IS_UCS4 + /* The char32_t encoding of a multibyte character is known to be the same as + the wchar_t encoding. */ + return WCHAR_FUNC (wc); +# else + /* The char32_t encoding of a multibyte character is known to be UCS-4, + different from the wchar_t encoding. */ + if (wc != WEOF) + return UCS_FUNC (wc); + else + return wc; +# endif + #else /* macOS, FreeBSD, NetBSD, OpenBSD, HP-UX, Solaris, Minix, Android */ /* char32_t and wchar_t are equivalent. */ static_assert (sizeof (char32_t) == sizeof (wchar_t));