Created
November 25, 2011 11:29
-
-
Save alisdair/1393322 to your computer and use it in GitHub Desktop.
logger_assert: macro to die when an expression is false, printing the function name, expression, file, and line
This file contains 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 STR(x) #x | |
#define STRINGIFY(x) STR(x) | |
#define LINESTR STRINGIFY(__LINE__) | |
#define logger_assert(x) if (!(x)) logger_die("%s: assertion failed: " #x \ | |
" (" __FILE__ ", line " LINESTR \ | |
")", __func__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment