From 54ce1b6171c582e374299b4f91e781c7d5ad2304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?joseLu=C3=ADs?= Date: Wed, 14 Jul 2021 21:28:56 +0200 Subject: [PATCH] [rust] remove NcFile for macos; #1937 #1938 - also remove the notcurses.debug method. --- rust/src/lib.rs | 2 ++ rust/src/notcurses/methods.rs | 6 +++++- rust/src/notcurses/test/reimplemented.rs | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 801829c14..77b2b07ab 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -121,6 +121,7 @@ mod dimension; mod direct; mod error; mod fade; +#[cfg(not(target_os = "macos"))] mod file; mod input; mod macros; @@ -143,6 +144,7 @@ pub use dimension::*; pub use direct::*; pub use error::*; pub use fade::*; +#[cfg(not(target_os = "macos"))] pub use file::*; pub use macros::*; pub use metric::*; diff --git a/rust/src/notcurses/methods.rs b/rust/src/notcurses/methods.rs index 1b67a8bcc..01270ac7f 100644 --- a/rust/src/notcurses/methods.rs +++ b/rust/src/notcurses/methods.rs @@ -4,12 +4,15 @@ use core::ptr::{null, null_mut}; use crate::{ cstring, error, error_ref_mut, notcurses_init, rstring, Nc, NcAlign, NcBlitter, NcChannels, - NcDim, NcError, NcFile, NcInput, NcLogLevel, NcOptions, NcPlane, NcResult, NcScale, NcStats, + NcDim, NcError, NcInput, NcLogLevel, NcOptions, NcPlane, NcResult, NcScale, NcStats, NcStyle, NcStyleMethods, NcTime, NCOPTION_NO_ALTERNATE_SCREEN, NCOPTION_SUPPRESS_BANNERS, NCRESULT_ERR, NCSTYLE_BLINK, NCSTYLE_BOLD, NCSTYLE_ITALIC, NCSTYLE_NONE, NCSTYLE_STRUCK, NCSTYLE_UNDERCURL, NCSTYLE_UNDERLINE, }; +#[cfg(not(target_os = "macos"))] +use crate::NcFile; + /// # `NcOptions` Constructors impl NcOptions { /// New NcOptions. @@ -294,6 +297,7 @@ impl Nc { /// planes, from all piles. /// /// *C style function: [notcurses_debug()][crate::notcurses_debug].* + #[cfg(not(target_os = "macos"))] pub fn debug(&mut self, debugfp: &mut NcFile) { unsafe { crate::notcurses_debug(self, debugfp.as_nc_ptr()); diff --git a/rust/src/notcurses/test/reimplemented.rs b/rust/src/notcurses/test/reimplemented.rs index c54fbcb5a..dd88f6b6a 100644 --- a/rust/src/notcurses/test/reimplemented.rs +++ b/rust/src/notcurses/test/reimplemented.rs @@ -3,7 +3,10 @@ use serial_test::serial; use std::io::Read; -use crate::{notcurses_init_test, notcurses_stop, NcFile, NCRESULT_MAX}; +use crate::{notcurses_init_test, notcurses_stop, NCRESULT_MAX}; + +#[cfg(not(target_os = "macos"))] +use crate::NcFile; #[test] #[serial] @@ -143,6 +146,7 @@ fn notcurses_at_yx() { #[test] #[serial] +#[cfg(not(target_os = "macos"))] fn notcurses_debug() { unsafe { let nc = notcurses_init_test();