1 | //! Utilities related to FFI bindings. |
---|---|
2 | |
3 | // If we have std, use it. |
4 | #[cfg(feature = "std")] |
5 | pub use { |
6 | std::ffi::{CStr, CString, FromBytesWithNulError, NulError}, |
7 | std::os::raw::c_char, |
8 | }; |
9 | |
10 | // If we don't have std, we can depend on core and alloc having these features |
11 | // in new versions of Rust. |
12 | #[cfg(not(feature = "std"))] |
13 | pub use { |
14 | alloc::ffi::{CString, NulError}, |
15 | core::ffi::{c_char, CStr, FromBytesWithNulError}, |
16 | }; |
17 |