Skip to content

Commit 17309d4

Browse files
committed
FreeBSD: use stat header in freebsd11/freebsd12 on aarch64
sys/stat.h is a machine-independent header, but it has ifdefs for i386. The version that was called x86_64.rs should be used on powerpc64 too, but I don't have a machine to test that on.
1 parent 45d9482 commit 17309d4

File tree

5 files changed

+8
-32
lines changed

5 files changed

+8
-32
lines changed

src/unix/bsd/freebsdlike/freebsd/aarch64.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,6 @@ pub type time_t = i64;
55
pub type suseconds_t = i64;
66
pub type register_t = i64;
77

8-
s! {
9-
pub struct stat {
10-
pub st_dev: ::dev_t,
11-
pub st_ino: ::ino_t,
12-
pub st_mode: ::mode_t,
13-
pub st_nlink: ::nlink_t,
14-
pub st_uid: ::uid_t,
15-
pub st_gid: ::gid_t,
16-
pub st_rdev: ::dev_t,
17-
pub st_atime: ::time_t,
18-
pub st_atime_nsec: ::c_long,
19-
pub st_mtime: ::time_t,
20-
pub st_mtime_nsec: ::c_long,
21-
pub st_ctime: ::time_t,
22-
pub st_ctime_nsec: ::c_long,
23-
pub st_size: ::off_t,
24-
pub st_blocks: ::blkcnt_t,
25-
pub st_blksize: ::blksize_t,
26-
pub st_flags: ::fflags_t,
27-
pub st_gen: u32,
28-
pub st_lspare: i32,
29-
pub st_birthtime: ::time_t,
30-
pub st_birthtime_nsec: ::c_long,
31-
}
32-
}
33-
348
pub const _MC_FP_VALID: ::c_int = 0x1;
359

3610
s! {

src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ extern "C" {
217217
}
218218

219219
cfg_if! {
220-
if #[cfg(target_arch = "x86_64")] {
221-
mod x86_64;
222-
pub use self::x86_64::*;
220+
if #[cfg(any(target_arch = "x86_64",
221+
target_arch = "aarch64"))] {
222+
mod b64;
223+
pub use self::b64::*;
223224
}
224225
}

src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ extern "C" {
217217
}
218218

219219
cfg_if! {
220-
if #[cfg(target_arch = "x86_64")] {
221-
mod x86_64;
222-
pub use self::x86_64::*;
220+
if #[cfg(any(target_arch = "x86_64",
221+
target_arch = "aarch64"))] {
222+
mod b64;
223+
pub use self::b64::*;
223224
}
224225
}

0 commit comments

Comments
 (0)