summaryrefslogtreecommitdiff
path: root/celt
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2018-03-23 13:25:01 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2018-03-27 15:13:26 -0400
commita29504cca7ba43d63dee26e7b0875f314364c9dd (patch)
tree8b3fe5ae227f3113faefdb47f7f9ffc66f2dd94e /celt
parentbf1d4420c25b515842c78be88898004cc28a34e9 (diff)
downloadopus-a29504cca7ba43d63dee26e7b0875f314364c9dd.tar.gz
Asserting on some ctl() calls that should never fail
Diffstat (limited to 'celt')
-rw-r--r--celt/arch.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/celt/arch.h b/celt/arch.h
index ffca8cf3..ad7bf283 100644
--- a/celt/arch.h
+++ b/celt/arch.h
@@ -79,9 +79,11 @@ void celt_fatal(const char *str, const char *file, int line)
#define celt_assert(cond) {if (!(cond)) {CELT_FATAL("assertion failed: " #cond);}}
#define celt_assert2(cond, message) {if (!(cond)) {CELT_FATAL("assertion failed: " #cond "\n" message);}}
+#define MUST_SUCCEED(call) celt_assert((call) == OPUS_OK)
#else
#define celt_assert(cond)
#define celt_assert2(cond, message)
+#define MUST_SUCCEED(call) do {if((call) != OPUS_OK) {RESTORE_STACK; return OPUS_INTERNAL_ERROR;} } while (0)
#endif
#if defined(ENABLE_ASSERTIONS)