Repository navigation
build(stty): compile on Haiku targets #15563
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,18 +45,22 @@ use flags::{CONTROL_CHARS, CONTROL_FLAGS, INPUT_FLAGS, LOCAL_FLAGS, OUTPUT_FLAGS | |
| const ASCII_DEL: u8 = 127; | ||
|
|
||
| // Sane defaults for control characters. | ||
| const SANE_CONTROL_CHARS: [(S, u8); 12] = [ | ||
| (S::VINTR, 3), // ^C | ||
| (S::VQUIT, 28), // ^\ | ||
| (S::VERASE, 127), // DEL | ||
| (S::VKILL, 21), // ^U | ||
| (S::VEOF, 4), // ^D | ||
| (S::VSTART, 17), // ^Q | ||
| (S::VSTOP, 19), // ^S | ||
| (S::VSUSP, 26), // ^Z | ||
| const SANE_CONTROL_CHARS: &[(S, u8)] = &[ | ||
| (S::VINTR, 3), // ^C | ||
| (S::VQUIT, 28), // ^\ | ||
| (S::VERASE, 127), // DEL | ||
| (S::VKILL, 21), // ^U | ||
| (S::VEOF, 4), // ^D | ||
| (S::VSTART, 17), // ^Q | ||
| (S::VSTOP, 19), // ^S | ||
| (S::VSUSP, 26), // ^Z | ||
| #[cfg(not(target_os = "haiku"))] | ||
| (S::VREPRINT, 18), // ^R | ||
| (S::VWERASE, 23), // ^W | ||
| (S::VLNEXT, 22), // ^V | ||
| #[cfg(not(target_os = "haiku"))] | ||
| (S::VWERASE, 23), // ^W | ||
| #[cfg(not(target_os = "haiku"))] | ||
| (S::VLNEXT, 22), // ^V | ||
| #[cfg(not(target_os = "haiku"))] | ||
| (S::VDISCARD, 15), // ^O | ||
| ]; | ||
|
|
||
|
|
@@ -1026,9 +1030,13 @@ fn combo_to_flags(combo: &str) -> Vec<ArgOptions<'_>> { | |
| (S::VSTART, "^Q"), | ||
| (S::VSTOP, "^S"), | ||
| (S::VSUSP, "^Z"), | ||
| #[cfg(not(target_os = "haiku"))] | ||
| (S::VREPRINT, "^R"), | ||
| #[cfg(not(target_os = "haiku"))] | ||
| (S::VWERASE, "^W"), | ||
| #[cfg(not(target_os = "haiku"))] | ||
| (S::VLNEXT, "^V"), | ||
| #[cfg(not(target_os = "haiku"))] | ||
| (S::VDISCARD, "^O"), | ||
| ], | ||
| _ => &[], | ||
|
|
@@ -1084,16 +1092,11 @@ fn combo_to_flags(combo: &str) -> Vec<ArgOptions<'_>> { | |
| } | ||
|
|
||
| fn get_sane_control_char(cc_index: S) -> u8 { | ||
| for (sane_index, sane_val) in SANE_CONTROL_CHARS { | ||
| if sane_index == cc_index { | ||
| return sane_val; | ||
| } | ||
| } | ||
| // Default values for control chars not in the sane list | ||
| match cc_index { | ||
| S::VMIN => 1, | ||
| _ => 0, | ||
| } | ||
| SANE_CONTROL_CHARS | ||
| .iter() | ||
| .copied() | ||
| .find_map(|(i, v)| (i == cc_index).then_some(v)) | ||
| .unwrap_or(u8::from(cc_index == S::VMIN)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about splitting this which does not conflict?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That said, I think do think it would be preferable to merge this before the more substantial changes in #15299.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where? cfg gate? |
||
| } | ||
|
|
||
| pub fn uu_app() -> Command { | ||
|
|
||
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.
I don't know what this is. But I'd like to have cfg_aliase for them.