From db8785d0e2b0910d7a55db59fcf3925c53bdea68 Mon Sep 17 00:00:00 2001 From: gnzlbg <gonzalobg88@gmail.com> Date: Wed, 25 Sep 2019 19:46:43 +0200 Subject: [PATCH] Do not use tuple structs --- src/unix/bsd/apple/b32/align.rs | 4 +++- src/unix/bsd/apple/b64/align.rs | 4 +++- src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs | 4 +++- src/unix/linux_like/android/b32/x86/align.rs | 4 +++- src/unix/linux_like/android/b64/aarch64/align.rs | 4 +++- src/unix/linux_like/android/b64/x86_64/align.rs | 4 +++- src/unix/linux_like/emscripten/align.rs | 4 +++- src/unix/linux_like/linux/gnu/b32/arm/align.rs | 4 +++- src/unix/linux_like/linux/gnu/b32/mips/align.rs | 4 +++- src/unix/linux_like/linux/gnu/b32/x86/align.rs | 4 +++- src/unix/linux_like/linux/gnu/b64/aarch64/align.rs | 4 +++- src/unix/linux_like/linux/gnu/b64/mips64/align.rs | 4 +++- src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs | 4 +++- src/unix/linux_like/linux/gnu/b64/sparc64/align.rs | 4 +++- src/unix/linux_like/linux/gnu/b64/x86_64/align.rs | 4 +++- src/unix/linux_like/linux/musl/b32/arm/align.rs | 4 +++- src/unix/linux_like/linux/musl/b32/mips/align.rs | 4 +++- src/unix/linux_like/linux/musl/b32/x86/align.rs | 4 +++- src/unix/linux_like/linux/musl/b64/aarch64/align.rs | 4 +++- src/unix/linux_like/linux/musl/b64/x86_64/align.rs | 4 +++- src/windows/gnu/align.rs | 10 ++++++++-- 21 files changed, 68 insertions(+), 22 deletions(-) diff --git a/src/unix/bsd/apple/b32/align.rs b/src/unix/bsd/apple/b32/align.rs index 374a994b..3750130a 100644 --- a/src/unix/bsd/apple/b32/align.rs +++ b/src/unix/bsd/apple/b32/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f64; 2]); + pub struct max_align_t { + priv_: [f64; 2] + } } diff --git a/src/unix/bsd/apple/b64/align.rs b/src/unix/bsd/apple/b64/align.rs index 374a994b..3750130a 100644 --- a/src/unix/bsd/apple/b64/align.rs +++ b/src/unix/bsd/apple/b64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f64; 2]); + pub struct max_align_t { + priv_: [f64; 2] + } } diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs index 33a0bc5d..340ad798 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f64; 4]); + pub struct max_align_t { + priv_: [f64; 4] + } } diff --git a/src/unix/linux_like/android/b32/x86/align.rs b/src/unix/linux_like/android/b32/x86/align.rs index b3abe679..50c79983 100644 --- a/src/unix/linux_like/android/b32/x86/align.rs +++ b/src/unix/linux_like/android/b32/x86/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(8))] - pub struct max_align_t([f64; 2]); + pub struct max_align_t { + priv_: [f64; 2] + } } diff --git a/src/unix/linux_like/android/b64/aarch64/align.rs b/src/unix/linux_like/android/b64/aarch64/align.rs index 9531ca4f..265118d8 100644 --- a/src/unix/linux_like/android/b64/aarch64/align.rs +++ b/src/unix/linux_like/android/b64/aarch64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f32; 8]); + pub struct max_align_t { + priv_: [f32; 8] + } } diff --git a/src/unix/linux_like/android/b64/x86_64/align.rs b/src/unix/linux_like/android/b64/x86_64/align.rs index 33a0bc5d..340ad798 100644 --- a/src/unix/linux_like/android/b64/x86_64/align.rs +++ b/src/unix/linux_like/android/b64/x86_64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f64; 4]); + pub struct max_align_t { + priv_: [f64; 4] + } } diff --git a/src/unix/linux_like/emscripten/align.rs b/src/unix/linux_like/emscripten/align.rs index e024ce08..c00a6fbd 100644 --- a/src/unix/linux_like/emscripten/align.rs +++ b/src/unix/linux_like/emscripten/align.rs @@ -2,7 +2,9 @@ macro_rules! expand_align { () => { s! { #[repr(align(8))] - pub struct max_align_t([f64; 2]); + pub struct max_align_t { + priv_: f64; 2] + } #[repr(align(4))] pub struct pthread_mutex_t { diff --git a/src/unix/linux_like/linux/gnu/b32/arm/align.rs b/src/unix/linux_like/linux/gnu/b32/arm/align.rs index 3817254b..52fffb7b 100644 --- a/src/unix/linux_like/linux/gnu/b32/arm/align.rs +++ b/src/unix/linux_like/linux/gnu/b32/arm/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(8))] - pub struct max_align_t([i64; 2]); + pub struct max_align_t { + priv_: [i64; 2] + } } diff --git a/src/unix/linux_like/linux/gnu/b32/mips/align.rs b/src/unix/linux_like/linux/gnu/b32/mips/align.rs index 8a5f872f..7bf5665c 100644 --- a/src/unix/linux_like/linux/gnu/b32/mips/align.rs +++ b/src/unix/linux_like/linux/gnu/b32/mips/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(8))] - pub struct max_align_t([f32; 4]); + pub struct max_align_t { + priv_: [f32; 4] + } } diff --git a/src/unix/linux_like/linux/gnu/b32/x86/align.rs b/src/unix/linux_like/linux/gnu/b32/x86/align.rs index afd65bac..a1afce4c 100644 --- a/src/unix/linux_like/linux/gnu/b32/x86/align.rs +++ b/src/unix/linux_like/linux/gnu/b32/x86/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f64; 6]); + pub struct max_align_t { + priv_: [f64; 6] + } } diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs index 9531ca4f..265118d8 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f32; 8]); + pub struct max_align_t { + priv_: [f32; 8] + } } diff --git a/src/unix/linux_like/linux/gnu/b64/mips64/align.rs b/src/unix/linux_like/linux/gnu/b64/mips64/align.rs index 33a0bc5d..340ad798 100644 --- a/src/unix/linux_like/linux/gnu/b64/mips64/align.rs +++ b/src/unix/linux_like/linux/gnu/b64/mips64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f64; 4]); + pub struct max_align_t { + priv_: [f64; 4] + } } diff --git a/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs b/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs index 56681afc..67e0f078 100644 --- a/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs +++ b/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([i64; 4]); + pub struct max_align_t { + priv_: [i64; 4] + } } diff --git a/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs b/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs index 56681afc..67e0f078 100644 --- a/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs +++ b/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([i64; 4]); + pub struct max_align_t { + priv_: [i64; 4] + } } diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs index 33a0bc5d..340ad798 100644 --- a/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs +++ b/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f64; 4]); + pub struct max_align_t { + priv_: [f64; 4] + } } diff --git a/src/unix/linux_like/linux/musl/b32/arm/align.rs b/src/unix/linux_like/linux/musl/b32/arm/align.rs index 6b2a39c9..cb1ab5d2 100644 --- a/src/unix/linux_like/linux/musl/b32/arm/align.rs +++ b/src/unix/linux_like/linux/musl/b32/arm/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(8))] - pub struct max_align_t(i64, i64); + pub struct max_align_t { + priv_: (i64, i64) + } } diff --git a/src/unix/linux_like/linux/musl/b32/mips/align.rs b/src/unix/linux_like/linux/musl/b32/mips/align.rs index 8a5f872f..7bf5665c 100644 --- a/src/unix/linux_like/linux/musl/b32/mips/align.rs +++ b/src/unix/linux_like/linux/musl/b32/mips/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(8))] - pub struct max_align_t([f32; 4]); + pub struct max_align_t { + priv_: [f32; 4] + } } diff --git a/src/unix/linux_like/linux/musl/b32/x86/align.rs b/src/unix/linux_like/linux/musl/b32/x86/align.rs index 707d113c..6caf90b3 100644 --- a/src/unix/linux_like/linux/musl/b32/x86/align.rs +++ b/src/unix/linux_like/linux/musl/b32/x86/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(8))] - pub struct max_align_t([f64; 3]); + pub struct max_align_t { + priv_: [f64; 3] + } } diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/align.rs b/src/unix/linux_like/linux/musl/b64/aarch64/align.rs index 9531ca4f..265118d8 100644 --- a/src/unix/linux_like/linux/musl/b64/aarch64/align.rs +++ b/src/unix/linux_like/linux/musl/b64/aarch64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f32; 8]); + pub struct max_align_t { + priv_: [f32; 8] + } } diff --git a/src/unix/linux_like/linux/musl/b64/x86_64/align.rs b/src/unix/linux_like/linux/musl/b64/x86_64/align.rs index 33a0bc5d..340ad798 100644 --- a/src/unix/linux_like/linux/musl/b64/x86_64/align.rs +++ b/src/unix/linux_like/linux/musl/b64/x86_64/align.rs @@ -1,4 +1,6 @@ s! { #[repr(align(16))] - pub struct max_align_t([f64; 4]); + pub struct max_align_t { + priv_: [f64; 4] + } } diff --git a/src/windows/gnu/align.rs b/src/windows/gnu/align.rs index 5459791a..d519b181 100644 --- a/src/windows/gnu/align.rs +++ b/src/windows/gnu/align.rs @@ -1,11 +1,17 @@ cfg_if! { if #[cfg(target_pointer_width = "64")] { s! { - #[repr(align(16))] pub struct max_align_t([f64; 4]); + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } } } else if #[cfg(target_pointer_width = "32")] { s! { - #[repr(align(16))] pub struct max_align_t([i64; 6]); + #[repr(align(16))] + pub struct max_align_t { + priv_: [i64; 6] + } } } } -- GitLab