Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 5 additions & 48 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ fn test_apple(target: &str) {
"os/clock.h",
"os/lock.h",
"os/signpost.h",
// FIXME(macos): Requires the macOS 14.4 SDK.
//"os/os_sync_wait_on_address.h",
"os/os_sync_wait_on_address.h",
"poll.h",
"pthread.h",
"pthread_spis.h",
Expand Down Expand Up @@ -308,85 +307,45 @@ fn test_apple(target: &str) {
// it is a moving target, changing through versions
// also contains bitfields members
"tcp_connection_info" => true,
// FIXME(macos): The size is changed in recent macOSes.
"malloc_introspection_t" => true,
// sonoma changes the padding `rmx_filler` field.
"rt_metrics" => true,
_ => false,
}
});

cfg.skip_alias(|ty| ty.ident().starts_with("__c_anonymous_"));
cfg.skip_alias(|ty| {
match ty.ident() {
// FIXME(macos): Requires the macOS 14.4 SDK.
"os_sync_wake_by_address_flags_t" | "os_sync_wait_on_address_flags_t" => true,

// FIXME(macos): "'__uint128' undeclared" in C
"__uint128" => true,

_ => false,
}
});

cfg.skip_const(move |constant| {
match constant.ident() {
// These OSX constants are removed in Sierra.
// FIXME(deprecated): These OSX constants are removed in Sierra.
// https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Darwin.html
"KERN_KDENABLE_BG_TRACE" | "KERN_KDDISABLE_BG_TRACE" => true,
// FIXME(macos): the value has been changed since Catalina (0xffff0000 -> 0x3fff0000).
"SF_SETTABLE" => true,

// FIXME(macos): XCode 13.1 doesn't have it.
// FIXME(deprecated): Removed since 12.0.1 / xnu-8019.41.5. See `ttycom.h` at
// https://github.com/apple-oss-distributions/xnu/commit/e6231be02a03711ca404e5121a151b24afbff733
"TIOCREMOTE" => true,

// FIXME(macos): Requires the macOS 14.4 SDK.
"OS_SYNC_WAKE_BY_ADDRESS_NONE"
| "OS_SYNC_WAKE_BY_ADDRESS_SHARED"
| "OS_SYNC_WAIT_ON_ADDRESS_NONE"
| "OS_SYNC_WAIT_ON_ADDRESS_SHARED" => true,

_ => false,
}
});

cfg.skip_fn(move |func| {
// skip those that are manually verified
match func.ident() {
// close calls the close_nocancel system call
"close" => true,

// FIXME(1.0): std removed libresolv support: https://github.com/rust-lang/rust/pull/102766
"res_init" => true,

// FIXME(macos): remove once the target in CI is updated
"pthread_jit_write_freeze_callbacks_np" => true,

// FIXME(macos): ABI has been changed on recent macOSes.
"os_unfair_lock_assert_owner" | "os_unfair_lock_assert_not_owner" => true,

// FIXME(macos): Once the SDK get updated to Ventura's level
"freadlink" | "mknodat" | "mkfifoat" => true,

// FIXME(macos): Requires the macOS 14.4 SDK.
"os_sync_wake_by_address_any"
| "os_sync_wake_by_address_all"
| "os_sync_wake_by_address_flags_t"
| "os_sync_wait_on_address"
| "os_sync_wait_on_address_flags_t"
| "os_sync_wait_on_address_with_deadline"
| "os_sync_wait_on_address_with_timeout" => true,

_ => false,
}
});

cfg.skip_struct_field(move |struct_, field| {
match (struct_.ident(), field.ident()) {
// FIXME(macos): the array size has been changed since macOS 10.15 ([8] -> [7]).
("statfs", "f_reserved") => true,
("__darwin_arm_neon_state64", "__v") => true,

// Anonymous ADT fields
("ifreq", "ifr_ifru") => true,
("in6_ifreq", "ifr_ifru") => true,
("ifkpi", "ifk_data") => true,
Expand Down Expand Up @@ -426,8 +385,6 @@ fn test_apple(target: &str) {
cfg.skip_roundtrip(move |s| match s {
// FIXME(macos): this type has the wrong ABI
"max_align_t" if i686 => true,
// Can't return an array from a C function.
"uuid_t" | "vol_capabilities_set_t" => true,
_ => false,
});

Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3131,6 +3131,7 @@ pub const TIOCMSET: c_ulong = 0x8004746d;
pub const TIOCMBIS: c_ulong = 0x8004746c;
pub const TIOCMBIC: c_ulong = 0x8004746b;
pub const TIOCMGET: c_ulong = 0x4004746a;
#[deprecated(since = "0.2.178", note = "Removed in MacOSX 12.0.1")]
pub const TIOCREMOTE: c_ulong = 0x80047469;
pub const TIOCGWINSZ: c_ulong = 0x40087468;
pub const TIOCSWINSZ: c_ulong = 0x80087467;
Expand Down Expand Up @@ -4585,7 +4586,7 @@ pub const UF_APPEND: c_uint = 0x00000004;
pub const UF_OPAQUE: c_uint = 0x00000008;
pub const UF_COMPRESSED: c_uint = 0x00000020;
pub const UF_TRACKED: c_uint = 0x00000040;
pub const SF_SETTABLE: c_uint = 0xffff0000;
pub const SF_SETTABLE: c_uint = 0x3fff0000;
pub const SF_ARCHIVED: c_uint = 0x00010000;
pub const SF_IMMUTABLE: c_uint = 0x00020000;
pub const SF_APPEND: c_uint = 0x00040000;
Expand Down
Loading