Skip to content

Commit 3667e65

Browse files
Go around rustc version limitations
1 parent 70b3858 commit 3667e65

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libc-test/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ fn test_apple(target: &str) {
321321
// FIXME: the array size has been changed since macOS 10.15 ([8] -> [7]).
322322
("statfs", "f_reserved") => true,
323323
("__darwin_arm_neon_state64", "__v") => true,
324+
// MAXPATHLEN is too big for auto-derive traits on arrays.
325+
("vnode_info_path", "vip_path") => true,
324326
_ => false,
325327
}
326328
});

src/unix/bsd/apple/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,9 @@ s! {
712712

713713
pub struct vnode_info_path {
714714
pub vip_vi: vnode_info,
715-
pub vip_path: [::c_char; ::MAXPATHLEN as usize],
715+
// Normally it's `vip_path: [::c_char; MAXPATHLEN]` but because libc supports an old rustc
716+
// version, we go around this limitation like this.
717+
pub vip_path: [[::c_char; 32]; 32],
716718
}
717719

718720
pub struct proc_vnodepathinfo {

0 commit comments

Comments
 (0)