Support all syntactic options of `std::assert!()` in `error_handler::assert!()` (prev `panic_if_not!()`
@@ -28,12 +28,18 @@ macro_rules! err {
#[macro_export]
macro_rules! assert{
- ($cond:expr) => {{
+ ($cond:expr $(,)?) => {{
if $crate::LOCATION_LOG && !$cond {
$crate::println!("\n!!! Error occurred @ {}, {}", file!(), line!())
}
::core::assert!($cond)
}};
+ ($cond:expr, $($arg:tt)+) => {{
+ if $crate::LOCATION_LOG && !$cond {
+ $crate::println!("\n!!! Error occurred @ {}, {}", file!(), line!())
+ }
+ ::core::assert!($cond, $($arg)+)
+ }};
}
#[macro_export]
