6 #ifdef TGT_OS_TYPE_VXWORKS
10 #if FW_ASSERT_LEVEL == FW_NO_ASSERT
14 #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT
15 #define fileIdFs "Assert file ID 0x%08X: Line: %d "
17 #define fileIdFs "Assert file \"%s\": Line: %d "
22 void defaultPrintAssert(
const I8* msg) {
23 (void)fprintf(stderr,
"%s\n",
reinterpret_cast<const char*
>(msg));
43 (void)snprintf((
char*)destBuffer,buffSize,fileIdFs,file,lineNo);
46 (void)snprintf((
char*)destBuffer,buffSize,fileIdFs
"%d",file,lineNo,
50 (void)snprintf((
char*)destBuffer,buffSize,fileIdFs
"%d %d",file,lineNo,
54 (void)snprintf((
char*)destBuffer,buffSize,fileIdFs
"%d %d %d",file,lineNo,
58 (void)snprintf((
char*)destBuffer,buffSize,fileIdFs
"%d %d %d %d",file,lineNo,
62 (void)snprintf((
char*)destBuffer,buffSize,fileIdFs
"%d %d %d %d %d",file,lineNo,
63 arg1,arg2,arg3,arg4,arg5);
66 (void)snprintf((
char*)destBuffer,buffSize,fileIdFs
"%d %d %d %d %d %d",file,lineNo,
67 arg1,arg2,arg3,arg4,arg5,arg6);
74 destBuffer[buffSize-1] = 0;
78 void AssertHook::printAssert(
const I8* msg) {
79 defaultPrintAssert(msg);
82 void AssertHook::reportAssert
111 this->printAssert(destBuffer);
114 void AssertHook::doAssert(
void) {
120 void AssertHook::registerHook(
void) {
121 this->previousHook = s_assertHook;
125 void AssertHook::deregisterHook() {
126 s_assertHook = this->previousHook;
130 if (
NULL == s_assertHook) {
137 assertMsg,
sizeof(assertMsg));
139 defaultPrintAssert(assertMsg);
143 s_assertHook->reportAssert(
148 s_assertHook->doAssert();
155 if (
NULL == s_assertHook) {
162 assertMsg,
sizeof(assertMsg));
164 defaultPrintAssert(assertMsg);
168 s_assertHook->reportAssert(
173 s_assertHook->doAssert();
181 if (
NULL == s_assertHook) {
188 assertMsg,
sizeof(assertMsg));
189 defaultPrintAssert(assertMsg);
193 s_assertHook->reportAssert(
198 s_assertHook->doAssert();
207 if (
NULL == s_assertHook) {
213 arg1,arg2,arg3,0,0,0,
214 assertMsg,
sizeof(assertMsg));
215 defaultPrintAssert(assertMsg);
219 s_assertHook->reportAssert(
223 arg1,arg2,arg3,0,0,0);
224 s_assertHook->doAssert();
234 if (
NULL == s_assertHook) {
240 arg1,arg2,arg3,arg4,0,0,
241 assertMsg,
sizeof(assertMsg));
242 defaultPrintAssert(assertMsg);
246 s_assertHook->reportAssert(
250 arg1,arg2,arg3,arg4,0,0);
251 s_assertHook->doAssert();
262 if (
NULL == s_assertHook) {
268 arg1,arg2,arg3,arg4,arg5,0,
269 assertMsg,
sizeof(assertMsg));
270 defaultPrintAssert(assertMsg);
274 s_assertHook->reportAssert(
278 arg1,arg2,arg3,arg4,arg5,0);
279 s_assertHook->doAssert();
291 if (
NULL == s_assertHook) {
297 arg1,arg2,arg3,arg4,arg5,arg6,
298 assertMsg,
sizeof(assertMsg));
299 defaultPrintAssert(assertMsg);
303 s_assertHook->reportAssert(
307 arg1,arg2,arg3,arg4,arg5,arg6);
308 s_assertHook->doAssert();
320 if (
NULL == Fw::s_assertHook) {
327 assertMsg,
sizeof(assertMsg));
330 Fw::s_assertHook->reportAssert(
335 Fw::s_assertHook->doAssert();
340 #endif // FW_NO_ASSERT