瀏覽代碼

Fix getting tty window size on more BSDs

src/term.rs:37:39: 37:49 error: unresolved name `TIOCGWINSZ` [E0425]
src/term.rs:37     let result = ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut window);
                                                     ^~~~~~~~~~
Jan Beich 10 年之前
父節點
當前提交
b9eb364823
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/term.rs

+ 7 - 1
src/term.rs

@@ -22,7 +22,13 @@ struct Winsize {
 #[cfg(any(target_os = "linux", target_os = "android"))]
 static TIOCGWINSZ: c_ulong = 0x5413;
 
-#[cfg(any(target_os = "macos", target_os = "ios", target_os = "dragonfly"))]
+#[cfg(any(target_os = "macos",
+          target_os = "ios",
+          target_os = "bitrig",
+          target_os = "dragonfly",
+          target_os = "freebsd",
+          target_os = "netbsd",
+          target_os = "openbsd"))]
 static TIOCGWINSZ: c_ulong = 0x40087468;
 
 extern {