Changeset 33520 in vbox for trunk/include/iprt
- Timestamp:
- Oct 27, 2010 3:20:10 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67114
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/assert.h
r32671 r33520 1323 1323 } while (0) 1324 1324 1325 /** @def AssertLogRelMsgStmt 1326 * Assert that an expression is true, execute \a stmt and break if it isn't 1327 * Strict builds will hit a breakpoint, non-strict will only do LogRel. 1328 * 1329 * @param expr Expression which should be true. 1330 * @param a printf argument list (in parenthesis). 1331 * @param stmt Statement to execute in case of a failed assertion. 1332 */ 1333 #define AssertLogRelMsgStmt(expr, a, stmt) \ 1334 do { \ 1335 if (RT_UNLIKELY(!(expr))) \ 1336 { \ 1337 RTAssertLogRelMsg1(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \ 1338 RTAssertLogRelMsg2(a); \ 1339 RTAssertPanic(); \ 1340 stmt; \ 1341 } \ 1342 } while (0) 1343 1325 1344 /** @def AssertLogRelMsgReturn 1326 1345 * Assert that an expression is true, return \a rc if it isn't. … … 1338 1357 RTAssertLogRelMsg2(a); \ 1339 1358 RTAssertPanic(); \ 1359 return (rc); \ 1360 } \ 1361 } while (0) 1362 1363 /** @def AssertLogRelMsgReturnStmt 1364 * Assert that an expression is true, execute \a stmt and return \a rc if it 1365 * isn't. 1366 * Strict builds will hit a breakpoint, non-strict will only do LogRel. 1367 * 1368 * @param expr Expression which should be true. 1369 * @param a printf argument list (in parenthesis). 1370 * @param rc What is to be presented to return. 1371 * @param stmt Statement to execute before return in case of a failed 1372 * assertion. 1373 */ 1374 #define AssertLogRelMsgReturnStmt(expr, a, rc, stmt) \ 1375 do { \ 1376 if (RT_UNLIKELY(!(expr))) \ 1377 { \ 1378 RTAssertLogRelMsg1(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \ 1379 RTAssertLogRelMsg2(a); \ 1380 RTAssertPanic(); \ 1381 stmt; \ 1340 1382 return (rc); \ 1341 1383 } \ … … 2104 2146 #define AssertLogRelRCReturn(rc, rcRet) AssertLogRelMsgRCReturn(rc, ("%Rra\n", (rc)), rcRet) 2105 2147 2148 /** @def AssertLogRelRCReturnStmt 2149 * Asserts a iprt status code successful, executing \a stmt and returning \a rc 2150 * if it isn't. 2151 * 2152 * @param rc iprt status code. 2153 * @param rcRet What is to be presented to return. 2154 * @param stmt Statement to execute before returning in case of a failed 2155 * assertion. 2156 * @remark rc is referenced multiple times. 2157 */ 2158 #define AssertLogRelRCReturnStmt(rc, rcRet, stmt) AssertLogRelMsgRCReturnStmt(rc, ("%Rra\n", (rc)), rcRet, stmt) 2159 2106 2160 /** @def AssertLogRelRCReturnVoid 2107 2161 * Asserts a iprt status code successful, returning (void) if it isn't. … … 2147 2201 */ 2148 2202 #define AssertLogRelMsgRCReturn(rc, msg, rcRet) AssertLogRelMsgReturn(RT_SUCCESS_NP(rc), msg, rcRet) 2203 2204 /** @def AssertLogRelMsgRCReturnStmt 2205 * Asserts a iprt status code successful, execute \a stmt and return on 2206 * failure. 2207 * 2208 * @param rc iprt status code. 2209 * @param msg printf argument list (in parenthesis). 2210 * @param rcRet What is to be presented to return. 2211 * @param stmt Statement to execute before break in case of a failed assertion. 2212 * @remark rc is referenced multiple times. 2213 */ 2214 #define AssertLogRelMsgRCReturnStmt(rc, msg, rcRet, stmt) AssertLogRelMsgReturnStmt(RT_SUCCESS_NP(rc), msg, rcRet, stmt) 2149 2215 2150 2216 /** @def AssertLogRelMsgRCReturnVoid
Note:
See TracChangeset
for help on using the changeset viewer.