mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Use $crate in the macros to refer to other macros
So you don't need to import all of them for them to work.
This commit is contained in:
16
src/debug.rs
16
src/debug.rs
@@ -19,12 +19,12 @@ macro_rules! nih_log {
|
||||
macro_rules! nih_debug_assert {
|
||||
($cond:expr $(,)?) => (
|
||||
if cfg!(debug_assertions) && !$cond {
|
||||
nih_log!(concat!("Debug assertion failed: ", stringify!($cond)));
|
||||
$crate::nih_log!(concat!("Debug assertion failed: ", stringify!($cond)));
|
||||
}
|
||||
);
|
||||
($cond:expr, $format:expr $(, $($args:tt)*)?) => (
|
||||
if cfg!(debug_assertions) && !$cond {
|
||||
nih_log!(concat!("Debug assertion failed: ", stringify!($cond), ", ", $format), $($($args)*)?);
|
||||
$crate::nih_log!(concat!("Debug assertion failed: ", stringify!($cond), ", ", $format), $($($args)*)?);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -35,12 +35,12 @@ macro_rules! nih_debug_assert {
|
||||
macro_rules! nih_debug_assert_failure {
|
||||
() => (
|
||||
if cfg!(debug_assertions) {
|
||||
nih_log!("Debug assertion failed");
|
||||
$crate::nih_log!("Debug assertion failed");
|
||||
}
|
||||
);
|
||||
($format:expr $(, $($args:tt)*)?) => (
|
||||
if cfg!(debug_assertions) {
|
||||
nih_log!(concat!("Debug assertion failed: ", $format), $($($args)*)?);
|
||||
$crate::nih_log!(concat!("Debug assertion failed: ", $format), $($($args)*)?);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -51,12 +51,12 @@ macro_rules! nih_debug_assert_failure {
|
||||
macro_rules! nih_debug_assert_eq {
|
||||
($left:expr, $right:expr $(,)?) => (
|
||||
if cfg!(debug_assertions) && $left != $right {
|
||||
nih_log!(concat!("Debug assertion failed: ", stringify!($left), " != ", stringify!($right)));
|
||||
$crate::nih_log!(concat!("Debug assertion failed: ", stringify!($left), " != ", stringify!($right)));
|
||||
}
|
||||
);
|
||||
($left:expr, $right:expr, $format:expr $(, $($args:tt)*)?) => (
|
||||
if cfg!(debug_assertions) && $left != $right {
|
||||
nih_log!(concat!("Debug assertion failed: ", stringify!($left), " != ", stringify!($right), ", ", $format), $($($args)*)?);
|
||||
$crate::nih_log!(concat!("Debug assertion failed: ", stringify!($left), " != ", stringify!($right), ", ", $format), $($($args)*)?);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -67,12 +67,12 @@ macro_rules! nih_debug_assert_eq {
|
||||
macro_rules! nih_debug_assert_ne {
|
||||
($left:expr, $right:expr $(,)?) => (
|
||||
if cfg!(debug_assertions) && $left == $right {
|
||||
nih_log!(concat!("Debug assertion failed: ", stringify!($left), " == ", stringify!($right)));
|
||||
$crate::nih_log!(concat!("Debug assertion failed: ", stringify!($left), " == ", stringify!($right)));
|
||||
}
|
||||
);
|
||||
($left:expr, $right:expr, $format:expr $(, $($args:tt)*)?) => (
|
||||
if cfg!(debug_assertions) && $left == $right {
|
||||
nih_log!(concat!("Debug assertion failed: ", stringify!($left), " == ", stringify!($right), ", ", $format), $($($args)*)?);
|
||||
$crate::nih_log!(concat!("Debug assertion failed: ", stringify!($left), " == ", stringify!($right), ", ", $format), $($($args)*)?);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user