Add wcswidth and test

This commit is contained in:
Jeremy Soller
2022-12-16 17:39:06 -07:00
parent 7d27737c3f
commit 393489b38b
244 changed files with 23 additions and 17 deletions
+11 -3
View File
@@ -637,9 +637,17 @@ pub extern "C" fn wcswcs(ws1: *const wchar_t, ws2: *const wchar_t) -> *mut wchar
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn wcswidth(pwcs: *const wchar_t, n: size_t) -> c_int {
unimplemented!();
#[no_mangle]
pub unsafe extern "C" fn wcswidth(pwcs: *const wchar_t, n: size_t) -> c_int {
let mut total_width = 0;
for i in 0..n {
let wc_width = wcwidth(*pwcs.add(i));
if wc_width < 0 {
return -1;
}
total_width += wc_width;
}
total_width
}
// #[no_mangle]
+1
View File
@@ -115,6 +115,7 @@ EXPECT_NAMES=\
wchar/wcstol \
wchar/wcscasecmp \
wchar/wcsncasecmp \
wchar/wcswidth \
wctype/towlower \
wctype/towupper
# TODO: Fix these
-1
View File
@@ -1 +0,0 @@
bins_dynamic/args test args
-6
View File
@@ -1,6 +0,0 @@
bins_dynamic/errno
bins_dynamic/errno
errno
yes, you can change this
yes, you can change this
yes, you can change this

Some files were not shown because too many files have changed in this diff Show More