xref: /third_party/rust/crates/rustix/src/ffi/mod.rs
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/rust/crates/rustix/src/ffi/
1b8a62b91Sopenharmony_ci//! Utilities related to FFI bindings.
2b8a62b91Sopenharmony_ci
3b8a62b91Sopenharmony_ci// If we have std, use it.
4b8a62b91Sopenharmony_ci#[cfg(feature = "std")]
5b8a62b91Sopenharmony_cipub use {
6b8a62b91Sopenharmony_ci    std::ffi::{CStr, CString, FromBytesWithNulError, NulError},
7b8a62b91Sopenharmony_ci    std::os::raw::c_char,
8b8a62b91Sopenharmony_ci};
9b8a62b91Sopenharmony_ci
10b8a62b91Sopenharmony_ci// If we don't have std, we can depend on core and alloc having these features
11b8a62b91Sopenharmony_ci// in new versions of Rust.
12b8a62b91Sopenharmony_ci#[cfg(not(feature = "std"))]
13b8a62b91Sopenharmony_cipub use {
14b8a62b91Sopenharmony_ci    alloc::ffi::{CString, NulError},
15b8a62b91Sopenharmony_ci    core::ffi::{c_char, CStr, FromBytesWithNulError},
16b8a62b91Sopenharmony_ci};
17

Indexes created Thu Nov 07 10:32:03 CST 2024