bolts: haiku build fix. (#2335)

This commit is contained in:
David CARLIER 2024-06-23 23:59:39 +01:00 committed by GitHub
parent b2635df524
commit 6db68970ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 11 deletions

View File

@ -506,7 +506,7 @@ pub unsafe fn setup_signal_handler<T: 'static + Handler>(handler: *mut T) -> Res
#[inline(always)]
pub fn ucontext() -> Result<ucontext_t, Error> {
let mut ucontext = unsafe { mem::zeroed() };
if cfg!(not(target_os = "openbsd")) {
if cfg!(not(any(target_os = "openbsd", target_os = "haiku"))) {
if unsafe { getcontext(&mut ucontext) } == 0 {
Ok(ucontext)
} else {

View File

@ -285,22 +285,24 @@ where
#[cfg(test)]
mod tests {
use alloc::{
string::{String, ToString},
vec::Vec,
};
#[cfg(not(target_os = "haiku"))]
use serial_test::serial;
use crate::{
shmem::{ShMemProvider, StdShMemProvider},
staterestore::StateRestorer,
};
#[test]
#[serial]
#[cfg_attr(miri, ignore)]
#[cfg(not(target_os = "haiku"))]
fn test_state_restore() {
use alloc::{
string::{String, ToString},
vec::Vec,
};
use crate::{
shmem::{ShMemProvider, StdShMemProvider},
staterestore::StateRestorer,
};
const TESTMAP_SIZE: usize = 1024;
let mut shmem_provider = StdShMemProvider::new().unwrap();