From a686d047d79bdfc37c096a4fa350c37e4ccf3cf5 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 3 Jun 2024 13:56:25 -0400 Subject: add LC_CTYPE epoch and use separate CT_ categories and CTM_ masks to support detecting change of LC_CTYPE between calls to wctype()/iswctype() and wctrans()/towctrans() --- src/wctype/iswctype.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/wctype/iswctype.c') diff --git a/src/wctype/iswctype.c b/src/wctype/iswctype.c index b1d1a3a1..ae952279 100644 --- a/src/wctype/iswctype.c +++ b/src/wctype/iswctype.c @@ -9,6 +9,10 @@ int iswctype(wint_t wc, wctype_t desc) ASSERT_REPRESENTABLE(wc, WCHAR_MIN, WCHAR_MAX, "wchar_t", WEOF); //ASSERT_REPRESENTABLE(desc, 1, __libc.wctype.nwctype, "wctype_t", 0); + if (__get_locale()->ctype_epoch != (desc >> CT_EPOCH_SHIFT)) { + UNDEFINED("LC_CTYPE has been changed since the call to wctype()"); + } + /* TODO: actual work */ (void)wc; (void)desc; -- cgit v1.2.1