From a29504cca7ba43d63dee26e7b0875f314364c9dd Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Fri, 23 Mar 2018 13:25:01 -0400 Subject: Asserting on some ctl() calls that should never fail --- celt/arch.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'celt') 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) -- cgit v1.2.3