diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2024-07-14 06:45:15 +0000 |
|---|---|---|
| committer | Chris Denton <chris@chrisdenton.dev> | 2024-07-15 05:01:20 +0000 |
| commit | e70cc288311e907f721e5dff9201be18c4e42640 (patch) | |
| tree | 3870a7afde11e2642d008ba3be11cdfb7c42f456 | |
| parent | b107cfa73cf70d391a14ca5de696b679ef8c2081 (diff) | |
| download | rust-e70cc288311e907f721e5dff9201be18c4e42640.tar.gz rust-e70cc288311e907f721e5dff9201be18c4e42640.zip | |
Remove LPWSTR
| -rw-r--r-- | library/std/src/sys/pal/windows/c.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/pal/windows/os.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/pal/windows/stdio.rs | 12 |
3 files changed, 8 insertions, 10 deletions
diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs index da96858d686..97fec6e59f0 100644 --- a/library/std/src/sys/pal/windows/c.rs +++ b/library/std/src/sys/pal/windows/c.rs @@ -28,8 +28,6 @@ pub type LPCVOID = *const c_void; pub type LPOVERLAPPED = *mut OVERLAPPED; pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES; pub type LPVOID = *mut c_void; -pub type LPWCH = *mut WCHAR; -pub type LPWSTR = *mut WCHAR; #[cfg(target_vendor = "win7")] pub type PSRWLOCK = *mut SRWLOCK; diff --git a/library/std/src/sys/pal/windows/os.rs b/library/std/src/sys/pal/windows/os.rs index 542fabcb665..ed7911b99cb 100644 --- a/library/std/src/sys/pal/windows/os.rs +++ b/library/std/src/sys/pal/windows/os.rs @@ -81,7 +81,7 @@ pub fn error_string(mut errnum: i32) -> String { } pub struct Env { - base: c::LPWCH, + base: *mut c::WCHAR, iter: EnvIterator, } @@ -126,7 +126,7 @@ impl Iterator for Env { } #[derive(Clone)] -struct EnvIterator(c::LPWCH); +struct EnvIterator(*mut c::WCHAR); impl Iterator for EnvIterator { type Item = (OsString, OsString); diff --git a/library/std/src/sys/pal/windows/stdio.rs b/library/std/src/sys/pal/windows/stdio.rs index 10aeeac07ea..995be689b46 100644 --- a/library/std/src/sys/pal/windows/stdio.rs +++ b/library/std/src/sys/pal/windows/stdio.rs @@ -182,12 +182,12 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usiz // Note that this theoretically checks validity twice in the (most common) case // where the underlying byte sequence is valid utf-8 (given the check in `write()`). let result = c::MultiByteToWideChar( - c::CP_UTF8, // CodePage - c::MB_ERR_INVALID_CHARS, // dwFlags - utf8.as_ptr(), // lpMultiByteStr - utf8.len() as c::c_int, // cbMultiByte - utf16.as_mut_ptr() as c::LPWSTR, // lpWideCharStr - utf16.len() as c::c_int, // cchWideChar + c::CP_UTF8, // CodePage + c::MB_ERR_INVALID_CHARS, // dwFlags + utf8.as_ptr(), // lpMultiByteStr + utf8.len() as c::c_int, // cbMultiByte + utf16.as_mut_ptr() as *mut c::WCHAR, // lpWideCharStr + utf16.len() as c::c_int, // cchWideChar ); assert!(result != 0, "Unexpected error in MultiByteToWideChar"); |
