Finish up preliminary tvos support in libstd

This commit is contained in:
Thom Chiovoloni 2023-03-14 20:02:42 -07:00
parent bdc3db944c
commit f978d7ea42
No known key found for this signature in database
5 changed files with 31 additions and 8 deletions

View file

@ -283,7 +283,13 @@ impl Drop for Thread {
}
}
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "ios", target_os = "watchos"))]
#[cfg(any(
target_os = "linux",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
))]
fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] {
let mut result = [0; MAX_WITH_NUL];
for (src, dst) in cstr.to_bytes().iter().zip(&mut result[..MAX_WITH_NUL - 1]) {