Last active
December 29, 2015 06:38
-
-
Save awreece/7629881 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CHECK(value, op, expected) \ | |
do { \ | |
__typeof__(value) _val = value; \ | |
__typeof__(expected) _exp = expected; \ | |
if (!(_val op _exp) { \ | |
fprintf(stderr, "Assertion failure on %s:%d: " \ | |
"expected " #value "(0x%x)" #op \ | |
#expected "(0x%x)", \ | |
__FILE__, __LINE__, _val, _exp); \ | |
abort(); \ | |
} \ | |
} while(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment