VirtualBox

Changeset 33766 in vbox for trunk/include/VBox/com


Ignore:
Timestamp:
Nov 4, 2010 2:05:28 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67403
Message:

VBoxManage: Implemented 'list extpacks', 'extpack install' and 'extpack uninstall'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/errorprint.h

    r30104 r33766  
    5757
    5858/**
     59 * Same as CHECK_ERROR except that it also executes the statement |stmt| on
     60 * failure.
     61 */
     62#define CHECK_ERROR_STMT(iface, method, stmt) \
     63    do { \
     64        rc = iface->method; \
     65        if (FAILED(rc)) \
     66        { \
     67            com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \
     68            stmt; \
     69        } \
     70    } while (0)
     71
     72/**
     73 * Same as CHECK_ERROR_STMT except that it uses an internal variable |hrcCheck|
     74 * for holding the result.
     75 */
     76#define CHECK_ERROR2_STMT(iface, method, stmt) \
     77    do { \
     78        HRESULT hrcCheck = iface->method; \
     79        if (FAILED(hrcCheck)) \
     80        { \
     81            com::GlueHandleComError(iface, #method, hrcCheck, __FILE__, __LINE__); \
     82            stmt; \
     83        } \
     84    } while (0)
     85
     86
     87/**
    5988 *  Does the same as CHECK_ERROR(), but executes the |break| statement on
    6089 *  failure.
     
    100129
    101130/**
     131 * Does the same as CHECK_ERROR(), but returns @a ret on failure.
     132 *
     133 * Unlike CHECK_ERROR and CHECK_ERROR_RET, this macro does not presuppose a
     134 * |rc| variable but instead employs a local variable |hrcCheck| in its own
     135 * scope.  This |hrcCheck| variable can be referenced by the @a rcRet
     136 * parameter.
     137 *
     138 * @param   iface       The interface pointer (can be a smart pointer object).
     139 * @param   method      The method to invoke together with the parameters.
     140 * @param   rcRet       What to return on failure.  Use |hrcCheck| to return
     141 *                      the status code of the method call.
     142 */
     143#define CHECK_ERROR2_RET(iface, method, rcRet) \
     144    do { \
     145        HRESULT hrcCheck = iface->method; \
     146        if (FAILED(hrcCheck)) \
     147        { \
     148            com::GlueHandleComError(iface, #method, hrcCheck, __FILE__, __LINE__); \
     149            return (rcRet); \
     150        } \
     151    } while (0)
     152
     153/**
    102154 *  Asserts the given expression is true. When the expression is false, prints
    103155 *  a line containing the failed function/line/file; otherwise does nothing.
Note: See TracChangeset for help on using the changeset viewer.

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