Interrupt in Debug mode, jump out of the assertions of the current function in Release mode, debugrelease
Interrupt in Debug mode and exit the assertions of the current function in Release Mode
# Ifdef DEBUG # define _ breakPoint_on_debug asm ("int3") # else # define _ breakPoint_on_debug # endif // verification # define UXY_ASSERT_RETURN_ON_RELEASE (_ condition, _ desc ,...) \ metam1__if_eq (0, metam1__argcount (_ VA_ARGS _) \ (_ XY_ASSERT_1 (_ condition, _ desc, _ VA_ARGS __)) \ (_ XY_ASSERT_2 (_ condition, _ desc, _ VA_ARGS _) # define _ XY_ASSERT_1 (_ condition, _ desc) \ if (! (_ Condition) _ breakPoint_on_debug; \ else return; # define _ XY_ASSERT_2 (_ condition, _ desc, _ returnedValue) \ if (! (_ Condition) _ breakPoint_on_debug; \ else return _ returnedValue;
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.