diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-12-23 08:39:09 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-12-23 08:39:09 +0100 |
commit | 71d7f39706f0f5004820f8d1d36c87d5f9ec3e97 (patch) | |
tree | 1938481028914a91b4f98d95675360d695febec9 /nihav-vivo/src/demuxers/mod.rs | |
parent | a970b2110488aeff5855743d1728ee83462e8306 (diff) | |
download | nihav-71d7f39706f0f5004820f8d1d36c87d5f9ec3e97.tar.gz |
make validate!() print message only in debug builds
Diffstat (limited to 'nihav-vivo/src/demuxers/mod.rs')
-rw-r--r-- | nihav-vivo/src/demuxers/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nihav-vivo/src/demuxers/mod.rs b/nihav-vivo/src/demuxers/mod.rs index 2f4a94d..145dafc 100644 --- a/nihav-vivo/src/demuxers/mod.rs +++ b/nihav-vivo/src/demuxers/mod.rs @@ -2,9 +2,14 @@ use nihav_core::demuxers::*; #[allow(unused_macros)] +#[cfg(debug_assertions)] macro_rules! validate { ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } }; } +#[cfg(not(debug_assertions))] +macro_rules! validate { + ($a:expr) => { if !$a { return Err(DemuxerError::InvalidData); } }; +} #[cfg(feature="demuxer_vivo")] mod vivo; |