From dbdcfed86e18673c71b54d4c4cd7be289441843c Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sun, 19 Nov 2023 22:18:35 +0000 Subject: [PATCH] termios: enabling supported SpecialCharacterIndices on haiku. (#2195) * termios: enabling supported SpecialCharacterIndices on haiku. * changelog entry --- changelog/2195.added.md | 1 + src/sys/termios.rs | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 changelog/2195.added.md diff --git a/changelog/2195.added.md b/changelog/2195.added.md new file mode 100644 index 0000000000..c523f22fd1 --- /dev/null +++ b/changelog/2195.added.md @@ -0,0 +1 @@ +Added `SpecialCharacterindices` support for haiku. diff --git a/src/sys/termios.rs b/src/sys/termios.rs index fa27801bac..6620cd6a14 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -512,13 +512,12 @@ libc_enum! { } // TODO: Make this usable directly as a slice index. -#[cfg(not(target_os = "haiku"))] libc_enum! { /// Indices into the `termios.c_cc` array for special characters. #[repr(usize)] #[non_exhaustive] pub enum SpecialCharacterIndices { - #[cfg(not(target_os = "aix"))] + #[cfg(not(any(target_os = "aix", target_os = "haiku")))] VDISCARD, #[cfg(any(target_os = "dragonfly", target_os = "freebsd", @@ -540,11 +539,13 @@ libc_enum! { VERASE2, VINTR, VKILL, + #[cfg(not(target_os = "haiku"))] VLNEXT, #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"), - target_os = "illumos", target_os = "solaris", target_os = "aix")))] + target_os = "illumos", target_os = "solaris", target_os = "aix", target_os = "haiku")))] VMIN, VQUIT, + #[cfg(not(target_os = "haiku"))] VREPRINT, VSTART, #[cfg(any(target_os = "dragonfly", @@ -562,9 +563,9 @@ libc_enum! { #[cfg(any(target_os = "haiku", target_os = "illumos", target_os = "solaris"))] VSWTCH, #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"), - target_os = "illumos", target_os = "solaris", target_os = "aix")))] + target_os = "illumos", target_os = "solaris", target_os = "aix", target_os = "haiku")))] VTIME, - #[cfg(not(target_os = "aix"))] + #[cfg(not(any(target_os = "aix", target_os = "haiku")))] VWERASE, #[cfg(target_os = "dragonfly")] VCHECKPT, @@ -576,6 +577,7 @@ libc_enum! { target_os = "illumos", target_os = "solaris", target_os = "aix", + target_os = "haiku", ))] impl SpecialCharacterIndices { pub const VMIN: SpecialCharacterIndices = SpecialCharacterIndices::VEOF;