diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2018-03-23 20:25:01 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2018-03-27 22:13:26 +0300 |
commit | a29504cca7ba43d63dee26e7b0875f314364c9dd (patch) | |
tree | 8b3fe5ae227f3113faefdb47f7f9ffc66f2dd94e /celt | |
parent | bf1d4420c25b515842c78be88898004cc28a34e9 (diff) |
Asserting on some ctl() calls that should never fail
Diffstat (limited to 'celt')
-rw-r--r-- | celt/arch.h | 2 |
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) |