From b6f6e08dce2bbbd7adc4a48342529c666685fe40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?joseLu=C3=ADs?= Date: Sat, 17 Jul 2021 20:38:06 +0200 Subject: [PATCH] [rust] use `FILE` instead of `_IO_FILE` #1938 also restore `NcFile` for `macos` to see if it makes a difference. --- rust/src/file.rs | 2 +- rust/src/lib.rs | 2 -- rust/src/notcurses/methods.rs | 7 +------ rust/src/notcurses/test/reimplemented.rs | 2 -- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/rust/src/file.rs b/rust/src/file.rs index 25429c3c1..dfd61de26 100644 --- a/rust/src/file.rs +++ b/rust/src/file.rs @@ -13,7 +13,7 @@ use libc::{ /// See [NcFile]. Notcurses functions expects this type of `*FILE` (a struct) #[allow(clippy::upper_case_acronyms)] -pub type FILE_NC = crate::ffi::_IO_FILE; +pub type FILE_NC = crate::ffi::FILE; /// See [NcFile]. The [`libc`](https://docs.rs/libc/) crate expects this type /// of `*FILE` (an opaque enum) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index b1039d9d2..30522b859 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -126,7 +126,6 @@ mod dimension; mod direct; mod error; mod fade; -#[cfg(not(target_os = "macos"))] mod file; mod input; mod macros; @@ -149,7 +148,6 @@ 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 cb520d399..1b67a8bcc 100644 --- a/rust/src/notcurses/methods.rs +++ b/rust/src/notcurses/methods.rs @@ -4,15 +4,12 @@ use core::ptr::{null, null_mut}; use crate::{ cstring, error, error_ref_mut, notcurses_init, rstring, Nc, NcAlign, NcBlitter, NcChannels, - NcDim, NcError, NcInput, NcLogLevel, NcOptions, NcPlane, NcResult, NcScale, NcStats, + NcDim, NcError, NcFile, 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. @@ -297,7 +294,6 @@ 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()); @@ -584,7 +580,6 @@ impl Nc { /// nothing will be written. /// /// *C style function: [notcurses_render_to_file()][crate::notcurses_render_to_file].* - #[cfg(not(target_os = "macos"))] pub fn render_to_file(&mut self, fp: &mut NcFile) -> NcResult<()> { error![unsafe { crate::notcurses_render_to_file(self, fp.as_nc_ptr()) }] } diff --git a/rust/src/notcurses/test/reimplemented.rs b/rust/src/notcurses/test/reimplemented.rs index dd88f6b6a..379bed661 100644 --- a/rust/src/notcurses/test/reimplemented.rs +++ b/rust/src/notcurses/test/reimplemented.rs @@ -5,7 +5,6 @@ use std::io::Read; use crate::{notcurses_init_test, notcurses_stop, NCRESULT_MAX}; -#[cfg(not(target_os = "macos"))] use crate::NcFile; #[test] @@ -146,7 +145,6 @@ fn notcurses_at_yx() { #[test] #[serial] -#[cfg(not(target_os = "macos"))] fn notcurses_debug() { unsafe { let nc = notcurses_init_test();