Changeset 103372 in vbox
- Timestamp:
- Feb 14, 2024 10:06:58 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/assert.h
r98103 r103372 531 531 #endif 532 532 533 /** @def AssertBreakStmt 534 * Assert that an expression is true and breaks if it isn't. 535 * In RT_STRICT mode it will hit a breakpoint before doing break. 536 * 537 * @param expr Expression which should be true. 538 * @param stmt Statement to execute before break in case of a failed assertion. 539 */ 540 #ifdef RT_STRICT 541 # define AssertBreakStmt(expr, stmt) \ 542 if (RT_LIKELY(!!(expr))) \ 543 { /* likely */ } \ 544 else if (1) \ 545 { \ 546 RTAssertMsg1Weak(#expr, __LINE__, __FILE__, RT_GCC_EXTENSION __PRETTY_FUNCTION__); \ 547 RTAssertPanic(); \ 548 stmt; \ 549 break; \ 550 } else do {} while (0) 551 #else 552 # define AssertBreakStmt(expr, stmt) \ 553 if (RT_LIKELY(!!(expr))) \ 554 { /* likely */ } \ 555 else if (1) \ 556 { \ 557 stmt; \ 558 break; \ 559 } else do {} while (0) 560 #endif 561 533 562 /** @def AssertContinue 534 563 * Assert that an expression is true and continue if it isn't. … … 555 584 #endif 556 585 557 /** @def Assert BreakStmt558 * Assert that an expression is true and breaksif it isn't.559 * In RT_STRICT mode it will hit a breakpoint before doing break.560 * 561 * @param expr Expression which should be true. 562 * @param stmt Statement to execute before breakin case of a failed assertion.563 */ 564 #ifdef RT_STRICT 565 # define Assert BreakStmt(expr, stmt) \586 /** @def AssertContinueStmt 587 * Assert that an expression is true and continue if it isn't. 588 * In RT_STRICT mode it will hit a breakpoint before continuing. 589 * 590 * @param expr Expression which should be true. 591 * @param stmt Statement to execute before contine in case of a failed assertion. 592 */ 593 #ifdef RT_STRICT 594 # define AssertContinueStmt(expr, stmt) \ 566 595 if (RT_LIKELY(!!(expr))) \ 567 596 { /* likely */ } \ … … 571 600 RTAssertPanic(); \ 572 601 stmt; \ 573 break; \602 continue; \ 574 603 } else do {} while (0) 575 604 #else 576 # define Assert BreakStmt(expr, stmt) \605 # define AssertContinueStmt(expr, stmt) \ 577 606 if (RT_LIKELY(!!(expr))) \ 578 607 { /* likely */ } \ 579 else if (1)\608 else \ 580 609 { \ 581 610 stmt; \ 582 break; \611 continue; 583 612 } else do {} while (0) 584 613 #endif
Note:
See TracChangeset
for help on using the changeset viewer.