VirtualBox

Changeset 15398 in vbox for trunk/include


Ignore:
Timestamp:
Dec 12, 2008 10:01:06 PM (16 years ago)
Author:
vboxsync
Message:

iprt: added some assertions

File:
1 edited

Legend:

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

    r14500 r15398  
    626626
    627627
     628/**
     629 * @def AssertFailedReturnStmt
     630 * An assertion failed, hit breakpoint (RT_STRICT mode only), execute a
     631 * statement and return a value.
     632 *
     633 * @param stmt The statement to execute.
     634 * @param rc   The value to return.
     635 */
     636#ifdef RT_STRICT
     637# define AssertFailedReturnStmt(stmt, rc)  \
     638    do { \
     639        AssertMsg1((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
     640        stmt; \
     641        RTAssertPanic(); \
     642        return (rc); \
     643    } while (0)
     644#else
     645# define AssertFailedReturnStmt(stmt, rc)  \
     646    do { \
     647        stmt; \
     648        return (rc); \
     649    } while (0)
     650#endif
     651
     652/**
     653 * @def AssertFailedReturnVoidStmt
     654 * An assertion failed, hit breakpoint (RT_STRICT mode only), execute a
     655 * statement and return.
     656 *
     657 * @param stmt The statement to execute.
     658 */
     659#ifdef RT_STRICT
     660# define AssertFailedReturnVoidStmt(stmt)  \
     661    do { \
     662        AssertMsg1((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
     663        stmt; \
     664        RTAssertPanic(); \
     665        return; \
     666    } while (0)
     667#else
     668# define AssertFailedReturnVoidStmt(stmt)  \
     669    do { \
     670        stmt; \
     671        return; \
     672    } while (0)
     673#endif
     674
     675
     676
    628677/** @def AssertFailedBreak
    629678 * An assertion failed, hit breakpoint (RT_STRICT mode only) and break.
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