From df25fc99b9d7dc9f470915d97f1d5103ae211fb3 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 6 Aug 2020 08:14:29 -0400 Subject: [PATCH] rust: generate direct mode bindings When we split direct.h out from notcurses.h, I forgot to add the new header file to the bindgen-rs includes. I've added it, and also added a simple directmode unit test. Closes #853. Thanks @joseluis for reporting this issue! --- rust/libnotcurses-sys/src/lib.rs | 12 +++++++++++- rust/libnotcurses-sys/wrapper.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/rust/libnotcurses-sys/src/lib.rs b/rust/libnotcurses-sys/src/lib.rs index 600a8ba39..ed21cfeda 100644 --- a/rust/libnotcurses-sys/src/lib.rs +++ b/rust/libnotcurses-sys/src/lib.rs @@ -95,11 +95,21 @@ mod tests { margin_r: 0, margin_b: 0, margin_l: 0, - flags: NCOPTION_NO_ALTERNATE_SCREEN as u64, + flags: (NCOPTION_NO_ALTERNATE_SCREEN | NCOPTION_INHIBIT_SETLOCALE) as u64, }; let nc = notcurses_init(&opts, std::ptr::null_mut()); notcurses_stop(nc); } } + #[test] + #[serial] + fn create_direct_context() { + unsafe { + let _ = libc::setlocale(libc::LC_ALL, std::ffi::CString::new("").unwrap().as_ptr()); + let nc = ncdirect_init(std::ptr::null_mut(), std::ptr::null_mut()); + ncdirect_stop(nc); + } + } + } diff --git a/rust/libnotcurses-sys/wrapper.h b/rust/libnotcurses-sys/wrapper.h index 7a83fdda3..831a234f2 100644 --- a/rust/libnotcurses-sys/wrapper.h +++ b/rust/libnotcurses-sys/wrapper.h @@ -1 +1,2 @@ #include +#include