Changeset 33766 in vbox for trunk/include/VBox/com
- Timestamp:
- Nov 4, 2010 2:05:28 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67403
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/errorprint.h
r30104 r33766 57 57 58 58 /** 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 /** 59 88 * Does the same as CHECK_ERROR(), but executes the |break| statement on 60 89 * failure. … … 100 129 101 130 /** 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 /** 102 154 * Asserts the given expression is true. When the expression is false, prints 103 155 * a line containing the failed function/line/file; otherwise does nothing.
Note:
See TracChangeset
for help on using the changeset viewer.