From 94907de9629a10a36862c37a43de5d56aeff9944 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 1 Nov 2023 10:06:44 +1100 Subject: [PATCH] Exclude test on alignment of AlignedType for wasm `libc v0.2.149` for the `wasm-unknown-unknown` target does not include the struct `max_align_t`. Feature gate the test that uses it so it doesn't get built in for WASM builds. --- secp256k1-sys/src/types.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/secp256k1-sys/src/types.rs b/secp256k1-sys/src/types.rs index 28ef0fb91..3cf6c0929 100644 --- a/secp256k1-sys/src/types.rs +++ b/secp256k1-sys/src/types.rs @@ -37,9 +37,12 @@ pub(crate) const ALIGN_TO: usize = core::mem::align_of::(); mod tests { extern crate libc; use std::any::TypeId; + #[cfg(not(target_arch = "wasm32"))] use std::mem; use std::os::raw; - use crate::{types, AlignedType}; + #[cfg(not(target_arch = "wasm32"))] + use crate::AlignedType; + use crate::types; #[test] fn verify_types() { @@ -48,6 +51,7 @@ mod tests { assert_eq!(TypeId::of::(), TypeId::of::()); assert_eq!(TypeId::of::(), TypeId::of::()); + #[cfg(not(target_arch = "wasm32"))] assert!(mem::align_of::() >= mem::align_of::()); } }