I saw somewhere assert used with a message in the following way:
assert((\"message\", condition));
This seems to work great, except that gc
Try:
#define assert__(x) for ( ; !(x) ; assert(x) )
use as such:
assert__(x) {
printf("assertion will fail\n");
}
Will execute the block only when assert fails.
IMPORTANT NOTE: This method will evaluate expression
xtwice, in casexevaluates tofalse! (First time, when theforloop is checking its condition; second time, when theassertis evaluating the passed expression!)