make validate!() print message only in debug builds
[nihav.git] / nihav-rad / src / codecs / mod.rs
index 6680c0f2712044b0ed0adc85b88e8c82143706f9..61b2e8c3cb0188a3465f238db90a1138c84eba08 100644 (file)
@@ -1,8 +1,13 @@
 use nihav_core::codecs::*;
 
+#[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(any(feature="decoder_smkaud", feature="decoder_smkvid"))]
 mod smacker;