From decdb067d63e04889edad9575f938bb3ec057b27 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Sun, 14 Jul 2024 21:32:13 +0000 Subject: [PATCH] Don't re-export `c_int` from `c` --- std/src/sys/pal/windows/c.rs | 3 +-- std/src/sys/pal/windows/stdio.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/std/src/sys/pal/windows/c.rs b/std/src/sys/pal/windows/c.rs index 0197be5be3afa..9982293fbb837 100644 --- a/std/src/sys/pal/windows/c.rs +++ b/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/std/src/sys/pal/windows/stdio.rs b/std/src/sys/pal/windows/stdio.rs index 44385fecf6e32..c6a21665157d7 100644 --- a/std/src/sys/pal/windows/stdio.rs +++ b/std/src/sys/pal/windows/stdio.rs @@ -181,9 +181,9 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result]) -> io::Result io::Result { - 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 { 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 )