From aa6afb9b693e39e9a62701d2f50af58138618505 Mon Sep 17 00:00:00 2001 From: Sebastian Humenda Date: Mon, 12 Mar 2018 22:22:44 +0100 Subject: [PATCH] redefine pthread_t for l4re-uclibc --- src/unix/uclibc/mips/mod.rs | 2 ++ src/unix/uclibc/mod.rs | 1 - src/unix/uclibc/x86_64/l4re.rs | 1 + src/unix/uclibc/x86_64/mod.rs | 5 ++++- src/unix/uclibc/x86_64/other.rs | 4 ++++ 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/unix/uclibc/x86_64/other.rs diff --git a/src/unix/uclibc/mips/mod.rs b/src/unix/uclibc/mips/mod.rs index cc3ddf25..d197249d 100644 --- a/src/unix/uclibc/mips/mod.rs +++ b/src/unix/uclibc/mips/mod.rs @@ -1,3 +1,5 @@ +pub type pthread_t = ::c_ulong; + pub const SFD_CLOEXEC: ::c_int = 0x080000; pub const NCCS: usize = 32; diff --git a/src/unix/uclibc/mod.rs b/src/unix/uclibc/mod.rs index 3f3a2bab..34edddaf 100644 --- a/src/unix/uclibc/mod.rs +++ b/src/unix/uclibc/mod.rs @@ -11,7 +11,6 @@ pub type id_t = ::c_uint; pub type useconds_t = u32; pub type dev_t = u64; pub type socklen_t = u32; -pub type pthread_t = ::c_ulong; pub type mode_t = u32; pub type ino64_t = u64; pub type off64_t = i64; diff --git a/src/unix/uclibc/x86_64/l4re.rs b/src/unix/uclibc/x86_64/l4re.rs index f047a82e..4f5811d1 100644 --- a/src/unix/uclibc/x86_64/l4re.rs +++ b/src/unix/uclibc/x86_64/l4re.rs @@ -4,6 +4,7 @@ /// libc and hence we should provide them here. pub type l4_umword_t = ::c_ulong; // Unsigned machine word. +pub type pthread_t = *mut ::c_void; s! { /// CPU sets. diff --git a/src/unix/uclibc/x86_64/mod.rs b/src/unix/uclibc/x86_64/mod.rs index 7d082589..bfd46447 100644 --- a/src/unix/uclibc/x86_64/mod.rs +++ b/src/unix/uclibc/x86_64/mod.rs @@ -352,6 +352,9 @@ cfg_if! { if #[cfg(target_os = "l4re")] { mod l4re; pub use self::l4re::*; - } else { } + } else { + mod other; + pub use other::*; + } } diff --git a/src/unix/uclibc/x86_64/other.rs b/src/unix/uclibc/x86_64/other.rs new file mode 100644 index 00000000..1cc521df --- /dev/null +++ b/src/unix/uclibc/x86_64/other.rs @@ -0,0 +1,4 @@ +// Thestyle checker discourages the use of #[cfg], so this has to go into a +// separate module +pub type pthread_t = ::c_ulong; +