Skip to content

Commit 05c1e92

Browse files
committed
Correct definition of CONSOLE_SCREEN_BUFFER_INFO
1 parent 853f300 commit 05c1e92

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/libterm/win.rs

+21-4
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,36 @@ pub struct WinConsole<T> {
2020
background: color::Color,
2121
}
2222

23+
type SHORT = i16;
2324
type WORD = u16;
2425
type DWORD = u32;
2526
type BOOL = i32;
2627
type HANDLE = *mut u8;
2728

29+
#[allow(non_snake_case)]
30+
#[repr(C)]
31+
struct SMALL_RECT {
32+
Left: SHORT,
33+
Top: SHORT,
34+
Right: SHORT,
35+
Bottom: SHORT,
36+
}
37+
38+
#[allow(non_snake_case)]
39+
#[repr(C)]
40+
struct COORD {
41+
X: SHORT,
42+
Y: SHORT,
43+
}
44+
2845
#[allow(non_snake_case)]
2946
#[repr(C)]
3047
struct CONSOLE_SCREEN_BUFFER_INFO {
31-
dwSize: [libc::c_short; 2],
32-
dwCursorPosition: [libc::c_short; 2],
48+
dwSize: COORD,
49+
dwCursorPosition: COORD,
3350
wAttributes: WORD,
34-
srWindow: [libc::c_short; 4],
35-
dwMaximumWindowSize: [libc::c_short; 2],
51+
srWindow: SMALL_RECT,
52+
dwMaximumWindowSize: COORD,
3653
}
3754

3855
#[allow(non_snake_case)]

0 commit comments

Comments
 (0)