aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-game/src/codecs/mod.rs
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2022-12-23 08:39:09 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2022-12-23 08:39:09 +0100
commit71d7f39706f0f5004820f8d1d36c87d5f9ec3e97 (patch)
tree1938481028914a91b4f98d95675360d695febec9 /nihav-game/src/codecs/mod.rs
parenta970b2110488aeff5855743d1728ee83462e8306 (diff)
downloadnihav-71d7f39706f0f5004820f8d1d36c87d5f9ec3e97.tar.gz
make validate!() print message only in debug builds
Diffstat (limited to 'nihav-game/src/codecs/mod.rs')
-rw-r--r--nihav-game/src/codecs/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/nihav-game/src/codecs/mod.rs b/nihav-game/src/codecs/mod.rs
index c31c6a3..14c6c87 100644
--- a/nihav-game/src/codecs/mod.rs
+++ b/nihav-game/src/codecs/mod.rs
@@ -1,9 +1,14 @@
use nihav_core::codecs::*;
#[allow(unused_macros)]
+#[cfg(debug_assertions)]
macro_rules! validate {
($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
}
+#[cfg(not(debug_assertions))]
+macro_rules! validate {
+ ($a:expr) => { if !$a { return Err(DecoderError::InvalidData); } };
+}
#[cfg(feature="decoder_arxel_vid")]
pub mod arxel_vid;