Skip to content

Commit 090129b

Browse files
committed
[LIBCNTPR] Implement NT version of iswctype
Passes all ntdll wine tests.
1 parent 5cbb2c9 commit 090129b

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

sdk/lib/crt/string/iswctype_nt.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* PROJECT: ReactOS NT CRT library
3+
* LICENSE: MIT (https://spdx.org/licenses/MIT)
4+
* PURPOSE: Implementation of iswctype
5+
* COPYRIGHT: Copyright 2025 Timo Kreuzer <[email protected]>
6+
*/
7+
8+
#include <ctype.h>
9+
10+
extern const unsigned short _wctype[];
11+
12+
_Check_return_
13+
int
14+
__cdecl
15+
iswctype(wint_t _C, wctype_t _Type)
16+
{
17+
if (_C <= 0xFF)
18+
return (_wctype[_C + 1] & _Type);
19+
20+
return 0;
21+
}

sdk/lib/crt/string/string.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ list(APPEND LIBCNTPR_STRING_SOURCE
33
string/_splitpath.c
44
string/_wsplitpath.c
55
string/ctype.c
6-
string/iswctype.c
76
string/is_wctype.c
87
string/scanf.c
98
string/strcspn.c
@@ -91,6 +90,7 @@ list(APPEND CRT_STRING_SOURCE
9190
string/_wcslwr_s.c
9291
string/_wsplitpath_s.c
9392
string/atof.c
93+
string/iswctype.c
9494
string/mbstowcs_s.c
9595
string/strcoll.c
9696
string/strdup.c
@@ -111,6 +111,7 @@ list(APPEND CRT_STRING_ASM_SOURCE
111111
)
112112

113113
list(APPEND LIBCNTPR_STRING_SOURCE
114+
string/iswctype_nt.c
114115
string/mbstowcs_nt.c
115116
string/tolower_nt.c
116117
string/toupper_nt_mb.c

0 commit comments

Comments
 (0)