VirtualBox

Changeset 32671 in vbox for trunk/include/iprt/assert.h


Ignore:
Timestamp:
Sep 21, 2010 4:24:03 PM (14 years ago)
Author:
vboxsync
Message:

Runtime/assert: add AssertReturnVoidStmt and AssertMsgRCReturnVoidStmt

File:
1 edited

Legend:

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

    r30253 r32671  
    19401940#define AssertRCReturnVoid(rc)      AssertMsgRCReturnVoid(rc, ("%Rra\n", (rc)))
    19411941
     1942/** @def AssertReturnVoidStmt
     1943 * Asserts a iprt status code successful, bitch (RT_STRICT mode only), and
     1944 * execute the given statement/return if it isn't.
     1945 *
     1946 * @param   rc      iprt status code.
     1947 * @param   stmt    Statement to execute before returning on failure.
     1948 * @remark  rc is referenced multiple times. In release mode is NOREF()'ed.
     1949 */
     1950#define AssertRCReturnVoidStmt(rc, stmt) AssertMsgRCReturnVoidStmt(rc, ("%Rra\n", (rc)), stmt)
     1951
    19421952/** @def AssertRCBreak
    19431953 * Asserts a iprt status code successful, bitch (RT_STRICT mode only) and break if it isn't.
     
    19942004    do { AssertMsgReturnVoid(RT_SUCCESS_NP(rc), msg); NOREF(rc); } while (0)
    19952005
     2006/** @def AssertMsgRCReturnVoidStmt
     2007 * Asserts a iprt status code successful and execute statement/break if it's not.
     2008 *
     2009 * If RT_STRICT is defined the message will be printed and a breakpoint hit before it returns
     2010 *
     2011 * @param   rc      iprt status code.
     2012 * @param   msg     printf argument list (in parenthesis).
     2013 * @param   stmt    Statement to execute before break in case of a failed assertion.
     2014 * @remark  rc is referenced multiple times. In release mode is NOREF()'ed.
     2015 */
     2016#define AssertMsgRCReturnVoidStmt(rc, msg, stmt) \
     2017    do { AssertMsgReturnVoidStmt(RT_SUCCESS_NP(rc), msg, stmt); NOREF(rc); } while (0)
     2018
    19962019/** @def AssertMsgRCBreak
    19972020 * Asserts a iprt status code successful and if it's not break.
     
    20072030
    20082031/** @def AssertMsgRCBreakStmt
    2009  * Asserts a iprt status code successful and break if it's not.
     2032 * Asserts a iprt status code successful and execute statement/break if it's not.
    20102033 *
    20112034 * If RT_STRICT is defined the message will be printed and a breakpoint hit before it returns
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