Cleaner c_char cfg logic
This commit is contained in:
parent
fc60b2c73e
commit
f9f734748c
2 changed files with 10 additions and 11 deletions
|
|
@ -37,11 +37,10 @@ use vec::Vec;
|
|||
///
|
||||
/// A `CString` is created from either a byte slice or a byte vector. After
|
||||
/// being created, a `CString` predominately inherits all of its methods from
|
||||
/// the `Deref` implementation to `[os::raw::c_char]`. Note that the underlying
|
||||
/// array is represented as an array of `os::raw::c_char` as opposed to `u8`. A
|
||||
/// `u8` slice can be obtained with the `as_bytes` method. Slices produced from
|
||||
/// a `CString` do *not* contain the trailing nul terminator unless otherwise
|
||||
/// specified.
|
||||
/// the `Deref` implementation to `[c_char]`. Note that the underlying array
|
||||
/// is represented as an array of `c_char` as opposed to `u8`. A `u8` slice
|
||||
/// can be obtained with the `as_bytes` method. Slices produced from a `CString`
|
||||
/// do *not* contain the trailing nul terminator unless otherwise specified.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@
|
|||
|
||||
#![stable(feature = "raw_os", since = "1.1.0")]
|
||||
|
||||
#[cfg(all(not(target_os = "ios"), not(target_os = "macos"),
|
||||
any(target_arch = "aarch64", target_arch = "arm",
|
||||
target_os = "android")))]
|
||||
#[cfg(any(target_os = "android",
|
||||
all(target_os = "linux", any(target_arch = "aarch64",
|
||||
target_arch = "arm"))))]
|
||||
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
|
||||
#[cfg(any(target_os = "ios", target_os = "macos",
|
||||
not(any(target_arch = "aarch64", target_arch = "arm",
|
||||
target_os = "android"))))]
|
||||
#[cfg(not(any(target_os = "android",
|
||||
all(target_os = "linux", any(target_arch = "aarch64",
|
||||
target_arch = "arm")))))]
|
||||
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = i8;
|
||||
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_schar = i8;
|
||||
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_uchar = u8;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue