-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FreeBSD support #3
Conversation
Nice! Thanks for doing this. |
@@ -106,7 +111,8 @@ use libc::{c_int,pid_t}; | |||
pub use ::os::target::{cc_t,speed_t,tcflag_t}; // types | |||
pub use ::os::target::{VEOF,VEOL,VERASE,VINTR,VKILL,VMIN,VQUIT,VSTART,VSTOP,VSUSP,VTIME}; // c_cc subscripts | |||
pub use ::os::target::{BRKINT,ICRNL,IGNBRK,IGNCR,IGNPAR,INLCR,INPCK,ISTRIP,IXANY,IXOFF,IXON,PARMRK}; // input modes | |||
pub use ::os::target::{OPOST,ONLCR,OCRNL,ONOCR,ONLRET,OFILL,NLDLY,NL0,NL1,CRDLY,CR0,CR1,CR2,CR3,TABDLY,TAB0,TAB1,TAB2,TAB3,BSDLY,BS0,BS1,VTDLY,VT0,VT1,FFDLY,FF0,FF1}; // output modes | |||
#[cfg(any(target_os = "linux", target_os = "macos"))] pub use ::os::target::{OPOST,ONLCR,OCRNL,ONOCR,ONLRET,OFILL,NLDLY,NL0,NL1,CRDLY,CR0,CR1,CR2,CR3,TABDLY,TAB0,TAB1,TAB2,TAB3,BSDLY,BS0,BS1,VTDLY,VT0,VT1,FFDLY,FF0,FF1}; // output modes | |||
#[cfg(target_os = "freebsd")] pub use ::os::target::{OPOST,ONLCR,TABDLY,TAB0,TAB3,ONOEOT,OCRNL,ONOCR,ONLRET}; // output modes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way the crate is organized, the constants exported here are supposed to be fairly cross platform. It was previously exporting just the POSIX-defined constants, but I didn't realize that BSD doesn't define some of them. I doubt any of the other constants are in common use, so I think it would be best to remove the other constants here for all OS's so that the interface remains the same on all platforms. The others will still be accessible through termios::os
. At least then it's clear for a user when they're using a constant that won't compile on all platforms. This will be a breaking change, but I can bump the version to v0.2.
Makes sense! Here's FreeBSD:
OpenBSD:
NetBSD:
OS X:
The least common subset seems to be And |
Looks great. Thanks! |
Should also add OpenBSD and NetBSD, but I don't have them running on anything right now…