Go to the documentation of this file.00001
00043 #if !defined (DBC_H)
00044 #define DBC_H
00045
00046
00047 #if defined (__cplusplus)
00048 extern "C" {
00049 #endif
00050
00051
00052 #if defined (_DEBUG)
00053
00054
00055
00056 #include <sys.h>
00057 #include <failure.h>
00058
00059
00060
00061
00062
00063 #if defined (DSPLINK_FAILURE_STOP)
00064 #if (defined(USE_CCS_BREAKPOINT) && defined( _55_ ))
00065
00073 #define DBC_assert(expr) for (; !( expr ); ) \
00074 CCS_BREAKPOINT ;
00075
00076 #else
00077
00078
00079 #define DBC_assert(c) \
00080 if (!(c)) { \
00081 SYS_abort ("Assertion Failed: file=%s, line=%d.\n", \
00082 __FILE__, \
00083 __LINE__); }
00084 #endif
00085
00086 #else
00087
00088
00089 #define DBC_assert(c) \
00090 if (!(c)) { \
00091 SYS_error ("Assertion Failed: file=%s, line=%d.\n", \
00092 SYS_EINVAL, \
00093 __FILE__, \
00094 __LINE__); }
00095
00096 #endif
00097
00098
00105 #define DBC_require DBC_assert
00106
00113 #define DBC_ensure DBC_assert
00114
00115 #else
00116
00123 #define DBC_assert(c)
00124 #define DBC_require(c)
00125 #define DBC_ensure(c)
00126
00127
00128 #endif
00129
00130
00131 #if defined (__cplusplus)
00132 }
00133 #endif
00134
00135
00136 #endif