aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/notbsd/android/b64/mod.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2019-05-24 18:07:22 -0700
committerDaniel Mueller <deso@posteo.net>2019-05-24 18:07:22 -0700
commit82cf43dd887801b8b22b8aae8c02854d921915d5 (patch)
treeb1bf3710bd07fe83e396a5db8563f3e6c5e85689 /libc/src/unix/notbsd/android/b64/mod.rs
parent06722702ea35434189d7de2b13a00209b2ebbd6d (diff)
downloadnitrocli-82cf43dd887801b8b22b8aae8c02854d921915d5.tar.gz
nitrocli-82cf43dd887801b8b22b8aae8c02854d921915d5.tar.bz2
Update libc crate to 0.2.55
This change updates the libc crate to version 0.2.55. Import subrepo libc/:libc at caf17a0641d29dc624621177f5756804dd180c13
Diffstat (limited to 'libc/src/unix/notbsd/android/b64/mod.rs')
-rw-r--r--libc/src/unix/notbsd/android/b64/mod.rs145
1 files changed, 125 insertions, 20 deletions
diff --git a/libc/src/unix/notbsd/android/b64/mod.rs b/libc/src/unix/notbsd/android/b64/mod.rs
index fb94334..46becc5 100644
--- a/libc/src/unix/notbsd/android/b64/mod.rs
+++ b/libc/src/unix/notbsd/android/b64/mod.rs
@@ -16,7 +16,7 @@ s! {
pub sa_flags: ::c_uint,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
- pub sa_restorer: ::dox::Option<extern fn()>,
+ pub sa_restorer: ::Option<extern fn()>,
}
pub struct rlimit64 {
@@ -34,25 +34,6 @@ s! {
__reserved: [::c_char; 16],
}
- pub struct pthread_mutex_t {
- value: ::c_int,
- __reserved: [::c_char; 36],
- }
-
- pub struct pthread_cond_t {
- value: ::c_int,
- __reserved: [::c_char; 44],
- }
-
- pub struct pthread_rwlock_t {
- numLocks: ::c_int,
- writerThreadId: ::c_int,
- pendingReaders: ::c_int,
- pendingWriters: ::c_int,
- attr: i32,
- __reserved: [::c_char; 36],
- }
-
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
@@ -126,6 +107,130 @@ s! {
}
}
+s_no_extra_traits!{
+ pub struct pthread_mutex_t {
+ value: ::c_int,
+ __reserved: [::c_char; 36],
+ }
+
+ pub struct pthread_cond_t {
+ value: ::c_int,
+ __reserved: [::c_char; 44],
+ }
+
+ pub struct pthread_rwlock_t {
+ numLocks: ::c_int,
+ writerThreadId: ::c_int,
+ pendingReaders: ::c_int,
+ pendingWriters: ::c_int,
+ attr: i32,
+ __reserved: [::c_char; 36],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for pthread_mutex_t {
+ fn eq(&self, other: &pthread_mutex_t) -> bool {
+ self.value == other.value
+ && self
+ .__reserved
+ .iter()
+ .zip(other.__reserved.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+
+ impl Eq for pthread_mutex_t {}
+
+ impl ::fmt::Debug for pthread_mutex_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("pthread_mutex_t")
+ .field("value", &self.value)
+ // FIXME: .field("__reserved", &self.__reserved)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for pthread_mutex_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.value.hash(state);
+ self.__reserved.hash(state);
+ }
+ }
+
+ impl PartialEq for pthread_cond_t {
+ fn eq(&self, other: &pthread_cond_t) -> bool {
+ self.value == other.value
+ && self
+ .__reserved
+ .iter()
+ .zip(other.__reserved.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+
+ impl Eq for pthread_cond_t {}
+
+ impl ::fmt::Debug for pthread_cond_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("pthread_cond_t")
+ .field("value", &self.value)
+ // FIXME: .field("__reserved", &self.__reserved)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for pthread_cond_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.value.hash(state);
+ self.__reserved.hash(state);
+ }
+ }
+
+ impl PartialEq for pthread_rwlock_t {
+ fn eq(&self, other: &pthread_rwlock_t) -> bool {
+ self.numLocks == other.numLocks
+ && self.writerThreadId == other.writerThreadId
+ && self.pendingReaders == other.pendingReaders
+ && self.pendingWriters == other.pendingWriters
+ && self.attr == other.attr
+ && self
+ .__reserved
+ .iter()
+ .zip(other.__reserved.iter())
+ .all(|(a,b)| a == b)
+ }
+ }
+
+ impl Eq for pthread_rwlock_t {}
+
+ impl ::fmt::Debug for pthread_rwlock_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("pthread_rwlock_t")
+ .field("numLocks", &self.numLocks)
+ .field("writerThreadId", &self.writerThreadId)
+ .field("pendingReaders", &self.pendingReaders)
+ .field("pendingWriters", &self.pendingWriters)
+ .field("attr", &self.attr)
+ // FIXME: .field("__reserved", &self.__reserved)
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for pthread_rwlock_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.numLocks.hash(state);
+ self.writerThreadId.hash(state);
+ self.pendingReaders.hash(state);
+ self.pendingWriters.hash(state);
+ self.attr.hash(state);
+ self.__reserved.hash(state);
+ }
+ }
+ }
+}
+
pub const RTLD_GLOBAL: ::c_int = 0x00100;
pub const RTLD_NOW: ::c_int = 2;
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;