Skip to content

Commit aebaae1

Browse files
committed
Finish up preliminary tvos support in libstd
1 parent ef6b970 commit aebaae1

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

library/core/src/ffi/mod.rs

+16-7
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl fmt::Debug for c_void {
234234
not(target_arch = "s390x"),
235235
not(target_arch = "x86_64")
236236
),
237-
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
237+
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
238238
target_family = "wasm",
239239
target_arch = "asmjs",
240240
target_os = "uefi",
@@ -263,7 +263,7 @@ pub struct VaListImpl<'f> {
263263
not(target_arch = "s390x"),
264264
not(target_arch = "x86_64")
265265
),
266-
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
266+
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
267267
target_family = "wasm",
268268
target_arch = "asmjs",
269269
target_os = "uefi",
@@ -288,7 +288,7 @@ impl<'f> fmt::Debug for VaListImpl<'f> {
288288
/// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf
289289
#[cfg(all(
290290
target_arch = "aarch64",
291-
not(any(target_os = "macos", target_os = "ios")),
291+
not(any(target_os = "macos", target_os = "ios", target_os = "tvos")),
292292
not(target_os = "uefi"),
293293
not(windows),
294294
))]
@@ -385,7 +385,10 @@ pub struct VaList<'a, 'f: 'a> {
385385
not(target_arch = "s390x"),
386386
not(target_arch = "x86_64")
387387
),
388-
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
388+
all(
389+
target_arch = "aarch64",
390+
any(target_os = "macos", target_os = "ios", target_os = "tvos")
391+
),
389392
target_family = "wasm",
390393
target_arch = "asmjs",
391394
target_os = "uefi",
@@ -400,7 +403,10 @@ pub struct VaList<'a, 'f: 'a> {
400403
target_arch = "s390x",
401404
target_arch = "x86_64"
402405
),
403-
any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))),
406+
any(
407+
not(target_arch = "aarch64"),
408+
not(any(target_os = "macos", target_os = "ios", target_os = "tvos"))
409+
),
404410
not(target_family = "wasm"),
405411
not(target_arch = "asmjs"),
406412
not(target_os = "uefi"),
@@ -418,7 +424,7 @@ pub struct VaList<'a, 'f: 'a> {
418424
not(target_arch = "s390x"),
419425
not(target_arch = "x86_64")
420426
),
421-
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
427+
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
422428
target_family = "wasm",
423429
target_arch = "asmjs",
424430
target_os = "uefi",
@@ -445,7 +451,10 @@ impl<'f> VaListImpl<'f> {
445451
target_arch = "s390x",
446452
target_arch = "x86_64"
447453
),
448-
any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))),
454+
any(
455+
not(target_arch = "aarch64"),
456+
not(any(target_os = "macos", target_os = "ios", target_os = "tvos"))
457+
),
449458
not(target_family = "wasm"),
450459
not(target_arch = "asmjs"),
451460
not(target_os = "uefi"),

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

+6
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",
@@ -180,6 +182,7 @@ impl FileDesc {
180182
target_os = "fuchsia",
181183
target_os = "illumos",
182184
target_os = "ios",
185+
target_os = "tvos",
183186
target_os = "linux",
184187
target_os = "macos",
185188
target_os = "netbsd",
@@ -221,6 +224,7 @@ impl FileDesc {
221224
#[cfg(any(
222225
all(target_os = "android", target_pointer_width = "32"),
223226
target_os = "ios",
227+
target_os = "tvos",
224228
target_os = "macos",
225229
))]
226230
pub fn read_vectored_at(&self, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io::Result<usize> {
@@ -319,6 +323,7 @@ impl FileDesc {
319323
target_os = "fuchsia",
320324
target_os = "illumos",
321325
target_os = "ios",
326+
target_os = "tvos",
322327
target_os = "linux",
323328
target_os = "macos",
324329
target_os = "netbsd",
@@ -360,6 +365,7 @@ impl FileDesc {
360365
#[cfg(any(
361366
all(target_os = "android", target_pointer_width = "32"),
362367
target_os = "ios",
368+
target_os = "tvos",
363369
target_os = "macos",
364370
))]
365371
pub fn write_vectored_at(&self, bufs: &[IoSlice<'_>], offset: u64) -> io::Result<usize> {

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

+1
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

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
8888
// The poll on Darwin doesn't set POLLNVAL for closed fds.
8989
target_os = "macos",
9090
target_os = "ios",
91+
target_os = "tvos",
9192
target_os = "watchos",
9293
target_os = "redox",
9394
target_os = "l4re",

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,13 @@ impl Drop for Thread {
284284
}
285285
}
286286

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

0 commit comments

Comments
 (0)