Skip to content

Commit e937f60

Browse files
committed
Make fpreg_t an union
1 parent 0e3fba9 commit e937f60

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

libc-test/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,8 +2727,6 @@ fn test_linux(target: &str) {
27272727
"utsname" if mips32 || mips64 => true,
27282728
// FIXME:
27292729
"mcontext_t" if s390x => true,
2730-
// FIXME: This is actually a union.
2731-
"fpreg_t" if s390x => true,
27322730

27332731
"sockaddr_un" | "sembuf" | "ff_constant_effect"
27342732
if mips32 && (gnu || musl) =>

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

Lines changed: 4 additions & 5 deletions
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)