Skip to content

Commit 514adf0

Browse files
committed
Auto merge of #3189 - ecnelises:aix_sigval_fix, r=JohnTitor
Remove AIX specific definition of sigval AIX definition of sigval is actually the same as other unix. Remove the union definition as other platforms treat it like a pointer after #3185.
2 parents 56a74a6 + 7a1d2c6 commit 514adf0

File tree

2 files changed

+3
-41
lines changed

2 files changed

+3
-41
lines changed

src/unix/aix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ s! {
303303
pub sigev_value: ::sigval,
304304
pub sigev_signo: ::c_int,
305305
pub sigev_notify: ::c_int,
306-
pub sigev_notify_function: extern fn(val: sigval),
306+
pub sigev_notify_function: extern fn(val: ::sigval),
307307
pub sigev_notify_attributes: *mut pthread_attr_t,
308308
}
309309

src/unix/aix/powerpc64.rs

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ s! {
9696
}
9797

9898
s_no_extra_traits! {
99-
#[cfg(libc_union)]
100-
pub union sigval {
101-
pub sival_ptr: *mut ::c_void,
102-
pub sival_int: ::c_int,
103-
}
104-
10599
pub struct siginfo_t {
106100
pub si_signo: ::c_int,
107101
pub si_errno: ::c_int,
@@ -111,8 +105,7 @@ s_no_extra_traits! {
111105
pub si_status: ::c_int,
112106
pub si_addr: *mut ::c_void,
113107
pub si_band: ::c_long,
114-
#[cfg(libc_union)]
115-
pub si_value: sigval,
108+
pub si_value: ::sigval,
116109
pub __si_flags: ::c_int,
117110
pub __pad: [::c_int; 3],
118111
}
@@ -197,7 +190,6 @@ impl siginfo_t {
197190
self.si_addr
198191
}
199192

200-
#[cfg(libc_union)]
201193
pub unsafe fn si_value(&self) -> ::sigval {
202194
self.si_value
203195
}
@@ -217,36 +209,6 @@ impl siginfo_t {
217209

218210
cfg_if! {
219211
if #[cfg(feature = "extra_traits")] {
220-
#[cfg(libc_union)]
221-
impl PartialEq for sigval {
222-
fn eq(&self, other: &sigval) -> bool {
223-
unsafe {
224-
self.sival_ptr == other.sival_ptr
225-
&& self.sival_int == other.sival_int
226-
}
227-
}
228-
}
229-
#[cfg(libc_union)]
230-
impl Eq for sigval {}
231-
#[cfg(libc_union)]
232-
impl ::fmt::Debug for sigval {
233-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
234-
f.debug_struct("sigval")
235-
.field("sival_ptr", unsafe { &self.sival_ptr })
236-
.field("sival_int", unsafe { &self.sival_int })
237-
.finish()
238-
}
239-
}
240-
#[cfg(libc_union)]
241-
impl ::hash::Hash for sigval {
242-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
243-
unsafe {
244-
self.sival_ptr.hash(state);
245-
self.sival_int.hash(state);
246-
}
247-
}
248-
}
249-
250212
impl PartialEq for siginfo_t {
251213
fn eq(&self, other: &siginfo_t) -> bool {
252214
#[cfg(libc_union)]
@@ -313,7 +275,7 @@ cfg_if! {
313275
#[cfg(libc_union)]
314276
impl ::fmt::Debug for _kernel_simple_lock {
315277
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
316-
f.debug_struct("sigval")
278+
f.debug_struct("_kernel_simple_lock")
317279
.field("_slock", unsafe { &self._slock })
318280
.field("_slockp", unsafe { &self._slockp })
319281
.finish()

0 commit comments

Comments
 (0)