aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-llaudio/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-llaudio/src/codecs/mod.rs
parenta970b2110488aeff5855743d1728ee83462e8306 (diff)
downloadnihav-71d7f39706f0f5004820f8d1d36c87d5f9ec3e97.tar.gz
make validate!() print message only in debug builds
Diffstat (limited to 'nihav-llaudio/src/codecs/mod.rs')
-rw-r--r--nihav-llaudio/src/codecs/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/nihav-llaudio/src/codecs/mod.rs b/nihav-llaudio/src/codecs/mod.rs
index a0e92bb..4f2a21a 100644
--- a/nihav-llaudio/src/codecs/mod.rs
+++ b/nihav-llaudio/src/codecs/mod.rs
@@ -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(feature="decoder_ape")]
pub mod ape;