#[cfg(not(feature = "antithesis"))]
#[macro_export]
macro_rules! turso_assert {
($cond:expr, $msg:literal, $($optional:tt)+) => {
assert!($cond, $msg, $($optional)+);
};
($cond:expr, $msg:literal) => {
assert!($cond, $msg);
};
}
#[cfg(feature = "antithesis")]
#[macro_export]
macro_rules! turso_assert {
($cond:expr, $msg:literal, $($optional:tt)+) => {
antithesis_sdk::assert_always_or_unreachable!($cond, $msg);
assert!($cond, $msg, $($optional)+);
};
($cond:expr, $msg:literal) => {
antithesis_sdk::assert_always_or_unreachable!($cond, $msg);
assert!($cond, $msg);
};
}
macro_rules! assert_send {
($($t:ty),+ $(,)?) => {
#[cfg(test)]
$(const _: () = {
const fn _assert_send<T: ?Sized + Send>() {}
_assert_send::<$t>();
};)+
};
}
pub(crate) use assert_send;
macro_rules! assert_sync {
($($t:ty),+ $(,)?) => {
#[cfg(test)]
$(const _: () = {
const fn _assert_sync<T: ?Sized + Sync>() {}
_assert_sync::<$t>();
};)+
};
}
pub(crate) use assert_sync;
macro_rules! assert_send_sync {
($($t:ty),+ $(,)?) => {
#[cfg(test)]
$(const _: () = {
const fn _assert_send<T: ?Sized + Send>() {}
const fn _assert_sync<T: ?Sized + Sync>() {}
_assert_send::<$t>();
_assert_sync::<$t>();
};)+
};
}
pub(crate) use assert_send_sync;