home *** CD-ROM | disk | FTP | other *** search
- #ifndef __EXCEPTIONS__
- #define __EXCEPTIONS__
-
- #if !defined(txtnDebug)
- #define NDEBUG
- #endif
-
- #include <Assert.h>
-
- #define check(exp) assert(exp)
- #define ncheck(exp) assert(!(exp))
-
- #define __DebuggerBreak Debugger()
-
- #define require_action(assertion, exception, action) \
- do { \
- if (assertion) ; \
- else { \
- __DebuggerBreak; \
- { action } \
- goto exception; \
- } \
- } while (false)
-
- #define require(assertion, exception) \
- do { \
- if (assertion) ; \
- else { \
- __DebuggerBreak; \
- goto exception; \
- } \
- } while (false)
-
- #define nrequire(assertion, exception) \
- do { \
- if (assertion) { \
- DebugStr("\p##assertion"); \
- goto exception; \
- } \
- } while (false)
-
- #endif