make validate!() print message only in debug builds
[nihav.git] / nihav-realmedia / src / demuxers / mod.rs
index 1b044a642f0a1643c051cf10efb5ce45d8d00cfd..820dd2eea79d102da70a53b36a5b2b15f8506603 100644 (file)
@@ -1,8 +1,13 @@
 use nihav_core::demuxers::*;
 
+#[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_real")]
 #[allow(clippy::identity_op)]