Skip to content

Commit e69caaa

Browse files
lib/std/os/windows/kernel32: add signature for SetConsoleMode (#18715)
- From lib/libc/include/any-windows-any/wincon.h#L235 - See also https://learn.microsoft.com/en-us/windows/console/setconsolemode - Also add DISABLE_NEWLINE_AUTO_RETURN constant which will be used by SetConsoleMode in lib/std/os/windows. Co-authored-by: Kexy Biscuit <[email protected]>
1 parent 4163126 commit e69caaa

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/std/os/windows.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3928,6 +3928,7 @@ pub const CONSOLE_SCREEN_BUFFER_INFO = extern struct {
39283928
};
39293929

39303930
pub const ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4;
3931+
pub const DISABLE_NEWLINE_AUTO_RETURN = 0x8;
39313932

39323933
pub const FOREGROUND_BLUE = 1;
39333934
pub const FOREGROUND_GREEN = 2;

lib/std/os/windows/kernel32.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ pub extern "kernel32" fn GetCommandLineA() callconv(WINAPI) LPSTR;
165165
pub extern "kernel32" fn GetCommandLineW() callconv(WINAPI) LPWSTR;
166166

167167
pub extern "kernel32" fn GetConsoleMode(in_hConsoleHandle: HANDLE, out_lpMode: *DWORD) callconv(WINAPI) BOOL;
168+
pub extern "kernel32" fn SetConsoleMode(in_hConsoleHandle: HANDLE, in_dwMode: DWORD) callconv(WINAPI) BOOL;
168169

169170
pub extern "kernel32" fn GetConsoleOutputCP() callconv(WINAPI) UINT;
170171

0 commit comments

Comments
 (0)