Skip to content

Commit 940fa85

Browse files
committed
Define INVALID_HANDLE_VALUE ourselves
1 parent 4e0fb98 commit 940fa85

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

library/std/src/sys/windows/c.rs

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ pub use FD_SET as fd_set;
4646
pub use LINGER as linger;
4747
pub use TIMEVAL as timeval;
4848

49+
pub const INVALID_HANDLE_VALUE: HANDLE = ::core::ptr::invalid_mut(-1i32 as _);
50+
4951
// https://learn.microsoft.com/en-us/cpp/c-runtime-library/exit-success-exit-failure?view=msvc-170
5052
pub const EXIT_SUCCESS: u32 = 0;
5153
pub const EXIT_FAILURE: u32 = 1;

library/std/src/sys/windows/c/windows_sys.lst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
--config flatten std
33
--filter
44
// tidy-alphabetical-start
5+
!Windows.Win32.Foundation.INVALID_HANDLE_VALUE
56
Windows.Wdk.Storage.FileSystem.FILE_COMPLETE_IF_OPLOCKED
67
Windows.Wdk.Storage.FileSystem.FILE_CONTAINS_EXTENDED_CREATE_INFORMATION
78
Windows.Wdk.Storage.FileSystem.FILE_CREATE
@@ -1923,7 +1924,6 @@ Windows.Win32.Foundation.HANDLE_FLAG_INHERIT
19231924
Windows.Win32.Foundation.HANDLE_FLAG_PROTECT_FROM_CLOSE
19241925
Windows.Win32.Foundation.HANDLE_FLAGS
19251926
Windows.Win32.Foundation.HMODULE
1926-
Windows.Win32.Foundation.INVALID_HANDLE_VALUE
19271927
Windows.Win32.Foundation.MAX_PATH
19281928
Windows.Win32.Foundation.NO_ERROR
19291929
Windows.Win32.Foundation.NTSTATUS

library/std/src/sys/windows/c/windows_sys.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3498,7 +3498,6 @@ impl ::core::clone::Clone for INIT_ONCE {
34983498
}
34993499
pub const INIT_ONCE_INIT_FAILED: u32 = 4u32;
35003500
pub const INVALID_FILE_ATTRIBUTES: u32 = 4294967295u32;
3501-
pub const INVALID_HANDLE_VALUE: HANDLE = ::core::ptr::invalid_mut(-1i32 as _);
35023501
pub const INVALID_SOCKET: SOCKET = -1i32 as _;
35033502
#[repr(C)]
35043503
pub struct IN_ADDR {

0 commit comments

Comments
 (0)