Skip to content

Commit c1a63d5

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 7eb82d3 + 7a1d2c6 commit c1a63d5

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
@@ -313,7 +313,7 @@ s! {
313313
pub sigev_value: ::sigval,
314314
pub sigev_signo: ::c_int,
315315
pub sigev_notify: ::c_int,
316-
pub sigev_notify_function: extern fn(val: sigval),
316+
pub sigev_notify_function: extern fn(val: ::sigval),
317317
pub sigev_notify_attributes: *mut pthread_attr_t,
318318
}
319319

src/unix/aix/powerpc64.rs

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,6 @@ s! {
185185
}
186186

187187
s_no_extra_traits! {
188-
#[cfg(libc_union)]
189-
pub union sigval {
190-
pub sival_ptr: *mut ::c_void,
191-
pub sival_int: ::c_int,
192-
}
193-
194188
pub struct siginfo_t {
195189
pub si_signo: ::c_int,
196190
pub si_errno: ::c_int,
@@ -200,8 +194,7 @@ s_no_extra_traits! {
200194
pub si_status: ::c_int,
201195
pub si_addr: *mut ::c_void,
202196
pub si_band: ::c_long,
203-
#[cfg(libc_union)]
204-
pub si_value: sigval,
197+
pub si_value: ::sigval,
205198
pub __si_flags: ::c_int,
206199
pub __pad: [::c_int; 3],
207200
}
@@ -286,7 +279,6 @@ impl siginfo_t {
286279
self.si_addr
287280
}
288281

289-
#[cfg(libc_union)]
290282
pub unsafe fn si_value(&self) -> ::sigval {
291283
self.si_value
292284
}
@@ -306,36 +298,6 @@ impl siginfo_t {
306298

307299
cfg_if! {
308300
if #[cfg(feature = "extra_traits")] {
309-
#[cfg(libc_union)]
310-
impl PartialEq for sigval {
311-
fn eq(&self, other: &sigval) -> bool {
312-
unsafe {
313-
self.sival_ptr == other.sival_ptr
314-
&& self.sival_int == other.sival_int
315-
}
316-
}
317-
}
318-
#[cfg(libc_union)]
319-
impl Eq for sigval {}
320-
#[cfg(libc_union)]
321-
impl ::fmt::Debug for sigval {
322-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
323-
f.debug_struct("sigval")
324-
.field("sival_ptr", unsafe { &self.sival_ptr })
325-
.field("sival_int", unsafe { &self.sival_int })
326-
.finish()
327-
}
328-
}
329-
#[cfg(libc_union)]
330-
impl ::hash::Hash for sigval {
331-
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
332-
unsafe {
333-
self.sival_ptr.hash(state);
334-
self.sival_int.hash(state);
335-
}
336-
}
337-
}
338-
339301
impl PartialEq for siginfo_t {
340302
fn eq(&self, other: &siginfo_t) -> bool {
341303
#[cfg(libc_union)]
@@ -402,7 +364,7 @@ cfg_if! {
402364
#[cfg(libc_union)]
403365
impl ::fmt::Debug for _kernel_simple_lock {
404366
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
405-
f.debug_struct("sigval")
367+
f.debug_struct("_kernel_simple_lock")
406368
.field("_slock", unsafe { &self._slock })
407369
.field("_slockp", unsafe { &self._slockp })
408370
.finish()

0 commit comments

Comments
 (0)