From 090129bb1d3af0d53e7ab1d36007115441e91dd4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 31 Jul 2025 09:35:17 +0300 Subject: [PATCH] [LIBCNTPR] Implement NT version of iswctype Passes all ntdll wine tests. --- sdk/lib/crt/string/iswctype_nt.c | 21 +++++++++++++++++++++ sdk/lib/crt/string/string.cmake | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 sdk/lib/crt/string/iswctype_nt.c diff --git a/sdk/lib/crt/string/iswctype_nt.c b/sdk/lib/crt/string/iswctype_nt.c new file mode 100644 index 00000000000..bb6f62115af --- /dev/null +++ b/sdk/lib/crt/string/iswctype_nt.c @@ -0,0 +1,21 @@ +/* + * PROJECT: ReactOS NT CRT library + * LICENSE: MIT (https://spdx.org/licenses/MIT) + * PURPOSE: Implementation of iswctype + * COPYRIGHT: Copyright 2025 Timo Kreuzer + */ + +#include + +extern const unsigned short _wctype[]; + +_Check_return_ +int +__cdecl +iswctype(wint_t _C, wctype_t _Type) +{ + if (_C <= 0xFF) + return (_wctype[_C + 1] & _Type); + + return 0; +} diff --git a/sdk/lib/crt/string/string.cmake b/sdk/lib/crt/string/string.cmake index 5dd203e2117..105231205a5 100644 --- a/sdk/lib/crt/string/string.cmake +++ b/sdk/lib/crt/string/string.cmake @@ -3,7 +3,6 @@ list(APPEND LIBCNTPR_STRING_SOURCE string/_splitpath.c string/_wsplitpath.c string/ctype.c - string/iswctype.c string/is_wctype.c string/scanf.c string/strcspn.c @@ -91,6 +90,7 @@ list(APPEND CRT_STRING_SOURCE string/_wcslwr_s.c string/_wsplitpath_s.c string/atof.c + string/iswctype.c string/mbstowcs_s.c string/strcoll.c string/strdup.c @@ -111,6 +111,7 @@ list(APPEND CRT_STRING_ASM_SOURCE ) list(APPEND LIBCNTPR_STRING_SOURCE + string/iswctype_nt.c string/mbstowcs_nt.c string/tolower_nt.c string/toupper_nt_mb.c