From 6605f08aeade93fb6d01c91a13d84769735dc172 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Fri, 27 Sep 2024 17:37:05 -0600 Subject: [PATCH] Fix definition of clock_t on FreeBSD x86, powerpc, powerpc64, and arm. https://github.com/freebsd/freebsd-src/blob/main/sys/arm/include/_types.h https://github.com/freebsd/freebsd-src/blob/main/sys/arm64/include/_types.h https://github.com/freebsd/freebsd-src/blob/main/sys/powerpc/include/_types.h https://github.com/freebsd/freebsd-src/blob/main/sys/riscv/include/_types.h https://github.com/freebsd/freebsd-src/blob/main/sys/x86/include/_types.h --- src/unix/bsd/freebsdlike/freebsd/aarch64.rs | 1 + src/unix/bsd/freebsdlike/freebsd/arm.rs | 1 + src/unix/bsd/freebsdlike/freebsd/mod.rs | 1 - src/unix/bsd/freebsdlike/freebsd/powerpc.rs | 1 + src/unix/bsd/freebsdlike/freebsd/powerpc64.rs | 1 + src/unix/bsd/freebsdlike/freebsd/riscv64.rs | 1 + src/unix/bsd/freebsdlike/freebsd/x86.rs | 1 + src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs | 1 + 8 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs index 0a1e51df88f36..05fe64b5c0c8a 100644 --- a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs @@ -1,6 +1,7 @@ pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; +pub type clock_t = i32; pub type wchar_t = u32; pub type time_t = i64; pub type suseconds_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs index fe014117a82b2..1325b930902b0 100644 --- a/src/unix/bsd/freebsdlike/freebsd/arm.rs +++ b/src/unix/bsd/freebsdlike/freebsd/arm.rs @@ -1,6 +1,7 @@ pub type c_char = u8; pub type c_long = i32; pub type c_ulong = u32; +pub type clock_t = u32; pub type wchar_t = u32; pub type time_t = i64; pub type suseconds_t = i32; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 03f148324c97a..108494d52482b 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1,5 +1,4 @@ pub type fflags_t = u32; -pub type clock_t = i32; pub type vm_prot_t = u_char; pub type kvaddr_t = u64; diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs index d1a5834d6134a..9690cb13cd310 100644 --- a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +++ b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs @@ -1,6 +1,7 @@ pub type c_char = u8; pub type c_long = i32; pub type c_ulong = u32; +pub type clock_t = u32; pub type wchar_t = i32; pub type time_t = i64; pub type suseconds_t = i32; diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs index bcd0d69435bce..08e7ad12c9c9b 100644 --- a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs @@ -1,6 +1,7 @@ pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; +pub type clock_t = u32; pub type wchar_t = i32; pub type time_t = i64; pub type suseconds_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs index 020d86b377daf..542c95b54453c 100644 --- a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs @@ -1,6 +1,7 @@ pub type c_char = u8; pub type c_long = i64; pub type c_ulong = u64; +pub type clock_t = i32; pub type wchar_t = ::c_int; pub type time_t = i64; pub type suseconds_t = ::c_long; diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs index f0f0dfa8f0077..8a2721e62d71b 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs @@ -1,6 +1,7 @@ pub type c_char = i8; pub type c_long = i32; pub type c_ulong = u32; +pub type clock_t = ::c_ulong; pub type wchar_t = i32; pub type time_t = i32; pub type suseconds_t = i32; diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs index cfc2ba2934338..4ff9469086cb6 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs @@ -1,6 +1,7 @@ pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; +pub type clock_t = i32; pub type wchar_t = i32; pub type time_t = i64; pub type suseconds_t = i64;