File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,27 @@ missing! {
43
43
}
44
44
pub type locale_t = * mut c_void ;
45
45
46
+ s_no_extra_traits ! {
47
+ pub union sigval {
48
+ pub sival_ptr: * mut c_void,
49
+ pub sival_int: c_int,
50
+ }
51
+ }
52
+
53
+ impl hash:: Hash for sigval {
54
+ fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
55
+ state. write_usize ( unsafe { self . sival_ptr } as usize ) ;
56
+ }
57
+ }
58
+
59
+ impl :: core:: cmp:: PartialEq for sigval {
60
+ fn eq ( & self , other : & Self ) -> bool {
61
+ unsafe { self . sival_ptr == other. sival_ptr }
62
+ }
63
+ }
64
+
65
+ impl :: core:: cmp:: Eq for sigval { }
66
+
46
67
s ! {
47
68
pub struct group {
48
69
pub gr_name: * mut c_char,
@@ -173,11 +194,6 @@ s! {
173
194
pub l_linger: c_int,
174
195
}
175
196
176
- pub struct sigval {
177
- // Actually a union of an int and a void*
178
- pub sival_ptr: * mut c_void,
179
- }
180
-
181
197
// <sys/time.h>
182
198
pub struct itimerval {
183
199
pub it_interval: crate :: timeval,
You can’t perform that action at this time.
0 commit comments