Skip to content

Commit 9129c8e

Browse files
committed
Make fpreg_t an union
1 parent 2c417b3 commit 9129c8e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

libc-test/build.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2680,8 +2680,6 @@ fn test_linux(target: &str) {
26802680
"utsname" if mips32 || mips64 => true,
26812681
// FIXME:
26822682
"mcontext_t" if s390x => true,
2683-
// FIXME: This is actually a union.
2684-
"fpreg_t" if s390x => true,
26852683

26862684
"sockaddr_un" | "sembuf" | "ff_constant_effect"
26872685
if mips32 && (gnu || musl) =>

src/unix/linux_like/linux/gnu/b64/s390x.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,17 @@ s! {
222222
}
223223

224224
s_no_extra_traits! {
225-
// FIXME: This is actually a union.
226-
pub struct fpreg_t {
225+
pub union fpreg_t {
227226
pub d: ::c_double,
228-
// f: ::c_float,
227+
pub f: ::c_float,
229228
}
230229
}
231230

232231
cfg_if! {
233232
if #[cfg(feature = "extra_traits")] {
234233
impl PartialEq for fpreg_t {
235234
fn eq(&self, other: &fpreg_t) -> bool {
236-
self.d == other.d
235+
unsafe { self.d == other.d }
237236
}
238237
}
239238

@@ -242,7 +241,7 @@ cfg_if! {
242241
impl ::fmt::Debug for fpreg_t {
243242
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
244243
f.debug_struct("fpreg_t")
245-
.field("d", &self.d)
244+
.field("d", unsafe { &self.d })
246245
.finish()
247246
}
248247
}

0 commit comments

Comments
 (0)