X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=mware%2Fexcept.h;h=b78435de3c9f45ee5133014560a3a85be48772f9;hb=99fafc49f3b2d50abb2d7b8b4cbbd3be8e107bef;hp=af4c06445c534ac580c15bb0d63759a78e7ed12e;hpb=7c03b1e47ddefae9577cfe0d2dd3f6fff83b57ec;p=bertos.git diff --git a/mware/except.h b/mware/except.h old mode 100755 new mode 100644 index af4c0644..b78435de --- a/mware/except.h +++ b/mware/except.h @@ -1,9 +1,34 @@ /** * \file * * * \brief C++-like structured exception handling for C programs @@ -32,15 +57,9 @@ extern jmp_buf except_stack[EXCEPT_CONTEXTS]; extern int except_top; -#ifdef _DEBUG -# define PUSH_EXCEPT ASSERT(except_top < EXCEPT_CONTEXTS), setjmp(except_stack[except_top++])) -# define POP_EXCEPT (ASSERT(except_top > 0), --except_top) -# define DO_EXCEPT (ASSERT(except_top > 0), longjmp(except_stack[--except_top], true)) -#else -# define PUSH_EXCEPT (setjmp(except_stack[except_top++])) -# define POP_EXCEPT (--except_top) -# define DO_EXCEPT (longjmp(except_stack[--except_top], true)) -#endif +#define PUSH_EXCEPT (ASSERT(except_top < EXCEPT_CONTEXTS), setjmp(except_stack[except_top++])) +#define POP_EXCEPT (ASSERT(except_top > 0), --except_top) +#define DO_EXCEPT (ASSERT(except_top > 0), longjmp(except_stack[--except_top], true)) /** * Jump buffer to use when throwing an exception or aborting an operation