VirtualBox

Changeset 60053 in vbox


Ignore:
Timestamp:
Mar 15, 2016 9:45:56 PM (9 years ago)
Author:
vboxsync
Message:

introduced AssertContinue()

File:
1 edited

Legend:

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

    r57926 r60053  
    675675/** @def AssertBreak
    676676 * Assert that an expression is true and breaks if it isn't.
    677  * In RT_STRICT mode it will hit a breakpoint before returning.
     677 * In RT_STRICT mode it will hit a breakpoint before breaking.
    678678 *
    679679 * @param   expr    Expression which should be true.
     
    691691#else
    692692# define AssertBreak(expr) \
     693    if (RT_LIKELY(!!(expr))) \
     694    { /* likely */ } \
     695    else \
     696        break
     697#endif
     698
     699/** @def AssertContinue
     700 * Assert that an expression is true and continue if it isn't.
     701 * In RT_STRICT mode it will hit a breakpoint before continuing.
     702 *
     703 * @param   expr    Expression which should be true.
     704 */
     705#ifdef RT_STRICT
     706# define AssertContinue(expr) \
     707    if (RT_LIKELY(!!(expr))) \
     708    { /* likely */ } \
     709    else if (1) \
     710    { \
     711        RTAssertMsg1Weak(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
     712        RTAssertPanic(); \
     713        break; \
     714    } else do {} while (0)
     715#else
     716# define AssertContinue(expr) \
    693717    if (RT_LIKELY(!!(expr))) \
    694718    { /* likely */ } \
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