diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2024-07-14 21:32:13 +0000 |
|---|---|---|
| committer | Chris Denton <chris@chrisdenton.dev> | 2024-07-15 05:01:23 +0000 |
| commit | ffe8fc276ea593d0e1b9c8aee6edb71a53190a43 (patch) | |
| tree | b21a5d6d0789eb96d2a16c97aff043d3bbef6150 | |
| parent | 8a1ce3dfcce533b9009d703f3bbf275a98b48ba4 (diff) | |
| download | rust-ffe8fc276ea593d0e1b9c8aee6edb71a53190a43.tar.gz rust-ffe8fc276ea593d0e1b9c8aee6edb71a53190a43.zip | |
Don't re-export `c_int` from `c`
| -rw-r--r-- | library/std/src/sys/pal/windows/c.rs | 3 | ||||
| -rw-r--r-- | library/std/src/sys/pal/windows/stdio.rs | 12 |
2 files changed, 7 insertions, 8 deletions
diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs index 0197be5be3a..9982293fbb8 100644 --- a/library/std/src/sys/pal/windows/c.rs +++ b/library/std/src/sys/pal/windows/c.rs @@ -7,8 +7,7 @@ use crate::ffi::CStr; use crate::mem; -pub use crate::os::raw::c_int; -use crate::os::raw::{c_char, c_uint, c_ulong, c_ushort, c_void}; +use crate::os::raw::{c_char, c_int, c_uint, c_ulong, c_ushort, c_void}; use crate::os::windows::io::{AsRawHandle, BorrowedHandle}; use crate::ptr; diff --git a/library/std/src/sys/pal/windows/stdio.rs b/library/std/src/sys/pal/windows/stdio.rs index 44385fecf6e..c6a21665157 100644 --- a/library/std/src/sys/pal/windows/stdio.rs +++ b/library/std/src/sys/pal/windows/stdio.rs @@ -181,9 +181,9 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usiz c::CP_UTF8, // CodePage c::MB_ERR_INVALID_CHARS, // dwFlags utf8.as_ptr(), // lpMultiByteStr - utf8.len() as c::c_int, // cbMultiByte + utf8.len() as i32, // cbMultiByte utf16.as_mut_ptr() as *mut c::WCHAR, // lpWideCharStr - utf16.len() as c::c_int, // cchWideChar + utf16.len() as i32, // cchWideChar ); assert!(result != 0, "Unexpected error in MultiByteToWideChar"); @@ -374,8 +374,8 @@ fn read_u16s(handle: c::HANDLE, buf: &mut [MaybeUninit<u16>]) -> io::Result<usiz } fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result<usize> { - debug_assert!(utf16.len() <= c::c_int::MAX as usize); - debug_assert!(utf8.len() <= c::c_int::MAX as usize); + debug_assert!(utf16.len() <= i32::MAX as usize); + debug_assert!(utf8.len() <= i32::MAX as usize); if utf16.is_empty() { return Ok(0); @@ -386,9 +386,9 @@ fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result<usize> { c::CP_UTF8, // CodePage c::WC_ERR_INVALID_CHARS, // dwFlags utf16.as_ptr(), // lpWideCharStr - utf16.len() as c::c_int, // cchWideChar + utf16.len() as i32, // cchWideChar utf8.as_mut_ptr(), // lpMultiByteStr - utf8.len() as c::c_int, // cbMultiByte + utf8.len() as i32, // cbMultiByte ptr::null(), // lpDefaultChar ptr::null_mut(), // lpUsedDefaultChar ) |
