Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/celt
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2018-03-23 20:25:01 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2018-03-27 22:13:26 +0300
commita29504cca7ba43d63dee26e7b0875f314364c9dd (patch)
tree8b3fe5ae227f3113faefdb47f7f9ffc66f2dd94e /celt
parentbf1d4420c25b515842c78be88898004cc28a34e9 (diff)
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)