Changeset 3111 in vbox
- Timestamp:
- Jun 14, 2007 5:42:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/assert.h
r2981 r3111 819 819 #define AssertRCReturn(rc, rcRet) AssertMsgRCReturn(rc, ("%Vra\n", (rc)), rcRet) 820 820 821 /** @def AssertRCReturnVoid 822 * Asserts a iprt status code successful, bitch (RT_STRICT mode only) and return if it isn't. 823 * 824 * @param rc iprt status code. 825 * @remark rc is references multiple times. In release mode is NOREF()'ed. 826 */ 827 #define AssertRCReturnVoid(rc) AssertMsgRCReturnVoid(rc, ("%Vra\n", (rc))) 828 821 829 /** @def AssertRCBreak 822 830 * Asserts a iprt status code successful, bitch (RT_STRICT mode only) and break if it isn't. … … 853 861 do { AssertMsgReturn(RT_SUCCESS(rc), msg, rcRet); NOREF(rc); } while (0) 854 862 863 /** @def AssertMsgRCReturnVoid 864 * Asserts a iprt status code successful and if it's not return. 865 * 866 * If RT_STRICT is defined the message will be printed and a breakpoint hit before it returns 867 * 868 * @param rc iprt status code. 869 * @param msg printf argument list (in parenthesis). 870 * @remark rc is references multiple times. In release mode is NOREF()'ed. 871 */ 872 #define AssertMsgRCReturnVoid(rc, msg) \ 873 do { AssertMsgReturnVoid(RT_SUCCESS(rc), msg); NOREF(rc); } while (0) 874 855 875 /** @def AssertMsgRCBreak 856 876 * Asserts a iprt status code successful and break if it's not. … … 885 905 #define AssertRCSuccessReturn(rc, rcRet) AssertMsgReturn((rc) == VINF_SUCCESS, ("%Vra\n", (rc)), rcRet) 886 906 907 /** @def AssertRCSuccessReturnVoid 908 * Asserts that an iprt status code equals VINF_SUCCESS, bitch (RT_STRICT mode only) and return if it isn't. 909 * 910 * @param rc iprt status code. 911 * @remark rc is references multiple times. In release mode is NOREF()'ed. 912 */ 913 #define AssertRCSuccessReturnVoid(rc) AssertMsgReturnVoid((rc) == VINF_SUCCESS, ("%Vra\n", (rc))) 914 887 915 /** @def AssertRCSuccessBreak 888 916 * Asserts that an iprt status code equals VINF_SUCCESS, bitch (RT_STRICT mode only) and break if it isn't. … … 917 945 #define AssertReleaseRCReturn(rc, rcRet) AssertReleaseMsgRCReturn(rc, ("%Vra\n", (rc)), rcRet) 918 946 947 /** @def AssertReleaseRCReturnVoid 948 * Asserts a iprt status code successful, returning if it isn't. 949 * 950 * On failure information about the error will be printed, a breakpoint hit 951 * and finally returning from the function if the breakpoint is somehow ignored. 952 * 953 * @param rc iprt status code. 954 * @remark rc is references multiple times. 955 */ 956 #define AssertReleaseRCReturnVoid(rc) AssertReleaseMsgRCReturnVoid(rc, ("%Vra\n", (rc))) 957 919 958 /** @def AssertReleaseRCBreak 920 959 * Asserts a iprt status code successful, break if it isn't. … … 953 992 #define AssertReleaseMsgRCReturn(rc, msg, rcRet) AssertReleaseMsgReturn(RT_SUCCESS(rc), msg, rcRet) 954 993 994 /** @def AssertReleaseMsgRCReturnVoid 995 * Asserts a iprt status code successful. 996 * 997 * On failure a custom message is printed, a breakpoint is hit, and finally 998 * returning from the function if the breakpoint is showhow ignored. 999 * 1000 * @param rc iprt status code. 1001 * @param msg printf argument list (in parenthesis). 1002 * @remark rc is references multiple times. 1003 */ 1004 #define AssertReleaseMsgRCReturnVoid(rc, msg) AssertReleaseMsgReturnVoid(RT_SUCCESS(rc), msg) 1005 955 1006 /** @def AssertReleaseMsgRCBreak 956 1007 * Asserts a iprt status code successful. … … 988 1039 #define AssertReleaseRCSuccessReturn(rc, rcRet) AssertReleaseMsgReturn((rc) == VINF_SUCCESS, ("%Vra\n", (rc)), rcRet) 989 1040 1041 /** @def AssertReleaseRCSuccessReturnVoid 1042 * Asserts that an iprt status code equals VINF_SUCCESS. 1043 * 1044 * On failure information about the error will be printed, a breakpoint hit 1045 * and finally returning from the function if the breakpoint is somehow ignored. 1046 * 1047 * @param rc iprt status code. 1048 * @remark rc is references multiple times. 1049 */ 1050 #define AssertReleaseRCSuccessReturnVoid(rc) AssertReleaseMsgReturnVoid((rc) == VINF_SUCCESS, ("%Vra\n", (rc))) 1051 990 1052 /** @def AssertReleaseRCSuccessBreak 991 1053 * Asserts that an iprt status code equals VINF_SUCCESS. … … 1048 1110 #define AssertPtrReturn(pv, rcRet) AssertMsgReturn(VALID_PTR(pv), ("%p\n", (pv)), rcRet) 1049 1111 1112 /** @def AssertPtrReturnVoid 1113 * Asserts that a pointer is valid. 1114 * 1115 * @param pv The pointer. 1116 */ 1117 #define AssertPtrReturnVoid(pv) AssertMsgReturnVoid(VALID_PTR(pv), ("%p\n", (pv))) 1118 1050 1119 /** @def AssertPtrBreak 1051 1120 * Asserts that a pointer is valid. … … 1070 1139 */ 1071 1140 #define AssertPtrNullReturn(pv, rcRet) AssertMsgReturn(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv)), rcRet) 1141 1142 /** @def AssertPtrNullReturnVoid 1143 * Asserts that a pointer is valid or NULL. 1144 * 1145 * @param pv The pointer. 1146 */ 1147 #define AssertPtrNullReturnVoid(pv) AssertMsgReturnVoid(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv))) 1072 1148 1073 1149 /** @def AssertPtrNullBreak
Note:
See TracChangeset
for help on using the changeset viewer.