Skip to content

Commit f978d7e

Browse files
committed
Finish up preliminary tvos support in libstd
1 parent bdc3db9 commit f978d7e

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

library/core/src/ffi/mod.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl fmt::Debug for c_void {
238238
not(target_arch = "s390x"),
239239
not(target_arch = "x86_64")
240240
),
241-
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
241+
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
242242
target_family = "wasm",
243243
target_arch = "asmjs",
244244
target_os = "uefi",
@@ -267,7 +267,7 @@ pub struct VaListImpl<'f> {
267267
not(target_arch = "s390x"),
268268
not(target_arch = "x86_64")
269269
),
270-
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
270+
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
271271
target_family = "wasm",
272272
target_arch = "asmjs",
273273
target_os = "uefi",
@@ -292,7 +292,7 @@ impl<'f> fmt::Debug for VaListImpl<'f> {
292292
/// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf
293293
#[cfg(all(
294294
target_arch = "aarch64",
295-
not(any(target_os = "macos", target_os = "ios")),
295+
not(any(target_os = "macos", target_os = "ios", target_os = "tvos")),
296296
not(target_os = "uefi"),
297297
not(windows),
298298
))]
@@ -389,7 +389,10 @@ pub struct VaList<'a, 'f: 'a> {
389389
not(target_arch = "s390x"),
390390
not(target_arch = "x86_64")
391391
),
392-
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
392+
all(
393+
target_arch = "aarch64",
394+
any(target_os = "macos", target_os = "ios", target_os = "tvos")
395+
),
393396
target_family = "wasm",
394397
target_arch = "asmjs",
395398
target_os = "uefi",
@@ -404,7 +407,10 @@ pub struct VaList<'a, 'f: 'a> {
404407
target_arch = "s390x",
405408
target_arch = "x86_64"
406409
),
407-
any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))),
410+
any(
411+
not(target_arch = "aarch64"),
412+
not(any(target_os = "macos", target_os = "ios", target_os = "tvos"))
413+
),
408414
not(target_family = "wasm"),
409415
not(target_arch = "asmjs"),
410416
not(target_os = "uefi"),
@@ -422,7 +428,7 @@ pub struct VaList<'a, 'f: 'a> {
422428
not(target_arch = "s390x"),
423429
not(target_arch = "x86_64")
424430
),
425-
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
431+
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
426432
target_family = "wasm",
427433
target_arch = "asmjs",
428434
target_os = "uefi",
@@ -449,7 +455,10 @@ impl<'f> VaListImpl<'f> {
449455
target_arch = "s390x",
450456
target_arch = "x86_64"
451457
),
452-
any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))),
458+
any(
459+
not(target_arch = "aarch64"),
460+
not(any(target_os = "macos", target_os = "ios", target_os = "tvos"))
461+
),
453462
not(target_family = "wasm"),
454463
not(target_arch = "asmjs"),
455464
not(target_os = "uefi"),

library/std/src/sys/unix/fd.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const READ_LIMIT: usize = libc::ssize_t::MAX as usize;
4444
target_os = "dragonfly",
4545
target_os = "freebsd",
4646
target_os = "ios",
47+
target_os = "tvos",
4748
target_os = "macos",
4849
target_os = "netbsd",
4950
target_os = "openbsd",
@@ -69,6 +70,7 @@ const fn max_iov() -> usize {
6970
target_os = "emscripten",
7071
target_os = "freebsd",
7172
target_os = "ios",
73+
target_os = "tvos",
7274
target_os = "linux",
7375
target_os = "macos",
7476
target_os = "netbsd",
@@ -181,6 +183,7 @@ impl FileDesc {
181183
target_os = "fuchsia",
182184
target_os = "illumos",
183185
target_os = "ios",
186+
target_os = "tvos",
184187
target_os = "linux",
185188
target_os = "macos",
186189
target_os = "netbsd",
@@ -222,6 +225,7 @@ impl FileDesc {
222225
#[cfg(any(
223226
all(target_os = "android", target_pointer_width = "32"),
224227
target_os = "ios",
228+
target_os = "tvos",
225229
target_os = "macos",
226230
))]
227231
pub fn read_vectored_at(&self, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io::Result<usize> {
@@ -320,6 +324,7 @@ impl FileDesc {
320324
target_os = "fuchsia",
321325
target_os = "illumos",
322326
target_os = "ios",
327+
target_os = "tvos",
323328
target_os = "linux",
324329
target_os = "macos",
325330
target_os = "netbsd",
@@ -361,6 +366,7 @@ impl FileDesc {
361366
#[cfg(any(
362367
all(target_os = "android", target_pointer_width = "32"),
363368
target_os = "ios",
369+
target_os = "tvos",
364370
target_os = "macos",
365371
))]
366372
pub fn write_vectored_at(&self, bufs: &[IoSlice<'_>], offset: u64) -> io::Result<usize> {

library/std/src/sys/unix/locks/pthread_condvar.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ impl LazyInit for AllocatedCondvar {
3232
if #[cfg(any(
3333
target_os = "macos",
3434
target_os = "ios",
35+
target_os = "tvos",
3536
target_os = "watchos",
3637
target_os = "l4re",
3738
target_os = "android",

library/std/src/sys/unix/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
8787
// The poll on Darwin doesn't set POLLNVAL for closed fds.
8888
target_os = "macos",
8989
target_os = "ios",
90+
target_os = "tvos",
9091
target_os = "watchos",
9192
target_os = "redox",
9293
target_os = "l4re",

library/std/src/sys/unix/thread.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,13 @@ impl Drop for Thread {
283283
}
284284
}
285285

286-
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "ios", target_os = "watchos"))]
286+
#[cfg(any(
287+
target_os = "linux",
288+
target_os = "macos",
289+
target_os = "ios",
290+
target_os = "tvos",
291+
target_os = "watchos",
292+
))]
287293
fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] {
288294
let mut result = [0; MAX_WITH_NUL];
289295
for (src, dst) in cstr.to_bytes().iter().zip(&mut result[..MAX_WITH_NUL - 1]) {

0 commit comments

Comments
 (0)