Changeset 103638 in vbox
- Timestamp:
- Mar 1, 2024 6:17:37 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/assert.h
r103446 r103638 1654 1654 #endif 1655 1655 1656 /** @def AssertReleaseStmt 1657 * Assert that an expression is true. If false, hit breakpoint and execute the 1658 * statement. 1659 * @param expr Expression which should be true. 1660 * @param stmt Statement to execute on failure. 1661 */ 1662 #if defined(RT_STRICT) || !defined(RTASSERT_NO_RELEASE_ASSERTIONS) 1663 # define AssertReleaseStmt(expr, stmt) \ 1664 do { \ 1665 if (RT_LIKELY(!!(expr))) \ 1666 { /* likely */ } \ 1667 else \ 1668 { \ 1669 RTAssertMsg1Weak(#expr, __LINE__, __FILE__, RT_GCC_EXTENSION __PRETTY_FUNCTION__); \ 1670 RTAssertReleasePanic(); \ 1671 stmt; \ 1672 } \ 1673 } while (0) 1674 #else 1675 # define AssertReleaseStmt(expr, stmt) \ 1676 do { \ 1677 if (RT_LIKELY(!!(expr))) \ 1678 { /* likely */ } \ 1679 else \ 1680 { \ 1681 stmt; \ 1682 } \ 1683 } while (0) 1684 #endif 1656 1685 1657 1686 /** @def AssertReleaseReturn … … 1922 1951 #endif 1923 1952 1953 /** @def AssertReleaseFailedStmt 1954 * An assertion failed, hit breakpoint and execute statement. 1955 */ 1956 #if defined(RT_STRICT) || !defined(RTASSERT_NO_RELEASE_ASSERTIONS) 1957 # define AssertReleaseFailedStmt(stmt) \ 1958 do { \ 1959 RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, RT_GCC_EXTENSION __PRETTY_FUNCTION__); \ 1960 RTAssertReleasePanic(); \ 1961 stmt; \ 1962 } while (0) 1963 #else 1964 # define AssertReleaseFailedStmt(stmt) do { stmt; } while (0) 1965 #endif 1966 1924 1967 /** @def AssertReleaseFailedReturn 1925 1968 * An assertion failed, hit a breakpoint and return.
Note:
See TracChangeset
for help on using the changeset viewer.