Changeset 47386 in vbox
- Timestamp:
- Jul 25, 2013 11:24:33 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/VirtualBoxBase.h
r45814 r47386 4 4 5 5 /* 6 * Copyright (C) 2006-201 2Oracle Corporation6 * Copyright (C) 2006-2013 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 213 213 214 214 /** 215 * Special version of the AssertMsgFailed macro to be used within VirtualBoxBase 216 * subclasses. 217 * 218 * See ComAssert for more info. 219 * 220 * @param a printf argument list (in parenthesis). 221 */ 222 #if defined(DEBUG) 223 #define ComAssertMsgFailed(a) AssertMsgFailed(a) 224 #else 225 #define ComAssertMsgFailed(a) \ 226 do { \ 227 setError(E_FAIL, \ 228 "Assertion failed: at '%s' (%d) in %s.\n%s.\nPlease contact the product vendor!", \ 229 __FILE__, __LINE__, __PRETTY_FUNCTION__, Utf8StrFmt a .c_str()); \ 230 } while (0) 231 #endif 232 233 /** 215 234 * Special version of the AssertRC macro to be used within VirtualBoxBase 216 235 * subclasses. … … 271 290 #define ComAssertComRCRetRC(rc) \ 272 291 do { ComAssertComRC(rc); if (!SUCCEEDED(rc)) return (rc); } while (0) 273 /** Special version of ComAssert that returns ret */274 #define ComAssertFailedRet(ret) 292 /** Special version of ComAssertFailed that returns ret */ 293 #define ComAssertFailedRet(ret) \ 275 294 do { ComAssertFailed(); return (ret); } while (0) 295 /** Special version of ComAssertMsgFailed that returns ret */ 296 #define ComAssertMsgFailedRet(msg, ret) \ 297 do { ComAssertMsgFailed(msg); return (ret); } while (0) 298 299 300 /** Special version of ComAssert that returns void if expr fails */ 301 #define ComAssertRetVoid(expr) \ 302 do { ComAssert(expr); if (!(expr)) return; } while (0) 303 /** Special version of ComAssertMsg that returns void if expr fails */ 304 #define ComAssertMsgRetVoid(expr, a) \ 305 do { ComAssertMsg(expr, a); if (!(expr)) return; } while (0) 306 /** Special version of ComAssertRC that returns void if vrc does not succeed */ 307 #define ComAssertRCRetVoid(vrc) \ 308 do { ComAssertRC(vrc); if (!RT_SUCCESS(vrc)) return; } while (0) 309 /** Special version of ComAssertComRC that returns void if rc does not succeed */ 310 #define ComAssertComRCRetVoid(rc) \ 311 do { ComAssertComRC(rc); if (!SUCCEEDED(rc)) return; } while (0) 312 /** Special version of ComAssertFailed that returns void */ 313 #define ComAssertFailedRetVoid() \ 314 do { ComAssertFailed(); return; } while (0) 315 /** Special version of ComAssertMsgFailed that returns void */ 316 #define ComAssertMsgFailedRetVoid(msg) \ 317 do { ComAssertMsgFailed(msg); return; } while (0) 276 318 277 319
Note:
See TracChangeset
for help on using the changeset viewer.