VirtualBox

Changeset 74500 in vbox for trunk


Ignore:
Timestamp:
Sep 27, 2018 1:49:29 PM (6 years ago)
Author:
vboxsync
Message:

iprt/assert.h: Added AssertLogRelStmt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/assert.h

    r73778 r74500  
    12081208        break
    12091209
     1210/** @def AssertLogRelStmt
     1211 * Assert that an expression is true, return \a rc if it isn't.
     1212 * Strict builds will hit a breakpoint, non-strict will only do LogRel.
     1213 *
     1214 * @param   expr    Expression which should be true.
     1215 * @param   stmt    Statement to execute in case of a failed assertion.
     1216 */
     1217#define AssertLogRelStmt(expr, stmt) \
     1218    do { \
     1219        if (RT_LIKELY(!!(expr))) \
     1220        { /* likely */ } \
     1221        else \
     1222        { \
     1223            RTAssertLogRelMsg1(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
     1224            RTAssertPanic(); \
     1225            stmt; \
     1226        } \
     1227    } while (0)
     1228
    12101229/** @def AssertLogRelMsg
    12111230 * Assert that an expression is true.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette