From b56d27586270d5dd2749d1aa9b98328da42d5099 Mon Sep 17 00:00:00 2001 From: Baasit Date: Sun, 17 Mar 2024 18:12:18 +0100 Subject: [PATCH] windows: Synchronize `st_mode` field and const types Link: https://github.com/microsoft/win32metadata/blob/9bde55b65e3ed63b0473c47c1ef1c5d359c48945/generation/WinSDK/RecompiledIdlHeaders/ucrt/sys/stat.h#L91 Fixes: https://github.com/rust-lang/libc/issues/3161 [ reword commit message - Trevor ] --- src/windows/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/windows/mod.rs b/src/windows/mod.rs index 27ecd0882234..0bdd2a967020 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -59,7 +59,7 @@ s! { pub struct stat { pub st_dev: dev_t, pub st_ino: ino_t, - pub st_mode: u16, + pub st_mode: c_ushort, pub st_nlink: ::c_short, pub st_uid: ::c_short, pub st_gid: ::c_short, @@ -142,13 +142,13 @@ pub const _O_OBTAIN_DIR: ::c_int = 0x2000; pub const O_SEQUENTIAL: ::c_int = 0x0020; pub const O_RANDOM: ::c_int = 0x0010; -pub const S_IFCHR: ::c_int = 0o2_0000; -pub const S_IFDIR: ::c_int = 0o4_0000; -pub const S_IFREG: ::c_int = 0o10_0000; -pub const S_IFMT: ::c_int = 0o17_0000; -pub const S_IEXEC: ::c_int = 0o0100; -pub const S_IWRITE: ::c_int = 0o0200; -pub const S_IREAD: ::c_int = 0o0400; +pub const S_IFCHR: ::c_ushort = 0o2_0000; +pub const S_IFDIR: ::c_ushort = 0o4_0000; +pub const S_IFREG: ::c_ushort = 0o10_0000; +pub const S_IFMT: ::c_ushort = 0o17_0000; +pub const S_IEXEC: ::c_ushort = 0o0100; +pub const S_IWRITE: ::c_ushort = 0o0200; +pub const S_IREAD: ::c_ushort = 0o0400; pub const LC_ALL: ::c_int = 0; pub const LC_COLLATE: ::c_int = 1;