diff options
| author | Lzu Tao <taolzu@gmail.com> | 2019-07-05 18:47:55 +0000 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2019-07-05 18:47:55 +0000 |
| commit | 05c1e92787d134c53a38c5eea7100caa7441fccd (patch) | |
| tree | 53a25ac6cd78c9481b5b492b9858e2042b2dd62b | |
| parent | 853f30052d019a8ebe197a5adff3a29d6716a955 (diff) | |
| download | rust-05c1e92787d134c53a38c5eea7100caa7441fccd.tar.gz rust-05c1e92787d134c53a38c5eea7100caa7441fccd.zip | |
Correct definition of CONSOLE_SCREEN_BUFFER_INFO
| -rw-r--r-- | src/libterm/win.rs | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/libterm/win.rs b/src/libterm/win.rs index 14ea68d3788..f5c60ee3522 100644 --- a/src/libterm/win.rs +++ b/src/libterm/win.rs @@ -20,6 +20,7 @@ pub struct WinConsole<T> { background: color::Color, } +type SHORT = i16; type WORD = u16; type DWORD = u32; type BOOL = i32; @@ -27,12 +28,28 @@ type HANDLE = *mut u8; #[allow(non_snake_case)] #[repr(C)] +struct SMALL_RECT { + Left: SHORT, + Top: SHORT, + Right: SHORT, + Bottom: SHORT, +} + +#[allow(non_snake_case)] +#[repr(C)] +struct COORD { + X: SHORT, + Y: SHORT, +} + +#[allow(non_snake_case)] +#[repr(C)] struct CONSOLE_SCREEN_BUFFER_INFO { - dwSize: [libc::c_short; 2], - dwCursorPosition: [libc::c_short; 2], + dwSize: COORD, + dwCursorPosition: COORD, wAttributes: WORD, - srWindow: [libc::c_short; 4], - dwMaximumWindowSize: [libc::c_short; 2], + srWindow: SMALL_RECT, + dwMaximumWindowSize: COORD, } #[allow(non_snake_case)] |
