Skip to content
Snippets Groups Projects
Unverified Commit dd3c2495 authored by gwenn's avatar gwenn Committed by GitHub
Browse files

Merge pull request #143 from mssun/master

Use into() instead of casting to c_ulong because of different types in some targets
parents 5680f812 69137f4f
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,8 @@ fn get_win_size() -> (usize, usize) { ...@@ -33,7 +33,8 @@ fn get_win_size() -> (usize, usize) {
unsafe { unsafe {
let mut size: libc::winsize = zeroed(); let mut size: libc::winsize = zeroed();
// https://github.com/rust-lang/libc/pull/704 // https://github.com/rust-lang/libc/pull/704
match libc::ioctl(STDOUT_FILENO, libc::TIOCGWINSZ as libc::c_ulong, &mut size) { // FIXME: ".into()" used as a temporary fix for a libc bug
match libc::ioctl(STDOUT_FILENO, libc::TIOCGWINSZ.into(), &mut size) {
0 => (size.ws_col as usize, size.ws_row as usize), // TODO getCursorPosition 0 => (size.ws_col as usize, size.ws_row as usize), // TODO getCursorPosition
_ => (80, 24), _ => (80, 24),
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment