Changeset 104808 in vbox
- Timestamp:
- May 28, 2024 10:46:02 PM (12 months ago)
- svn:sync-xref-src-repo-rev:
- 163383
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/assert.h
r103638 r104808 1198 1198 } while (0) 1199 1199 1200 /** @def AssertLogRelReturnStmt 1201 * Assert that an expression is true, execute \a stmt & return \a rc if it 1202 * isn't. Strict builds will hit a breakpoint, non-strict will only do LogRel. 1203 * 1204 * @param expr Expression which should be true. 1205 * @param stmt Statement to execute before break in case of a failed 1206 * assertion. 1207 * @param rc What is to be presented to return. 1208 */ 1209 #define AssertLogRelReturnStmt(expr, stmt, rc) \ 1210 do { \ 1211 if (RT_LIKELY(!!(expr))) \ 1212 { /* likely */ } \ 1213 else \ 1214 { \ 1215 RTAssertLogRelMsg1(#expr, __LINE__, __FILE__, RT_GCC_EXTENSION __PRETTY_FUNCTION__); \ 1216 RTAssertPanic(); \ 1217 stmt; \ 1218 return (rc); \ 1219 } \ 1220 } while (0) 1221 1200 1222 /** @def AssertLogRelReturnVoid 1201 1223 * Assert that an expression is true, return void if it isn't. … … 1212 1234 RTAssertLogRelMsg1(#expr, __LINE__, __FILE__, RT_GCC_EXTENSION __PRETTY_FUNCTION__); \ 1213 1235 RTAssertPanic(); \ 1236 return; \ 1237 } \ 1238 } while (0) 1239 1240 /** @def AssertLogRelReturnVoidStmt 1241 * Assert that an expression is true, execute \a stmt & return void if it isn't. 1242 * Strict builds will hit a breakpoint, non-strict will only do LogRel. 1243 * 1244 * @param expr Expression which should be true. 1245 * @param stmt Statement to execute before break in case of a failed 1246 * assertion. 1247 */ 1248 #define AssertLogRelReturnVoidStmt(expr, stmt) \ 1249 do { \ 1250 if (RT_LIKELY(!!(expr))) \ 1251 { /* likely */ } \ 1252 else \ 1253 { \ 1254 RTAssertLogRelMsg1(#expr, __LINE__, __FILE__, RT_GCC_EXTENSION __PRETTY_FUNCTION__); \ 1255 RTAssertPanic(); \ 1256 stmt; \ 1214 1257 return; \ 1215 1258 } \
Note:
See TracChangeset
for help on using the changeset viewer.