Created
August 30, 2013 17:56
-
-
Save jmbr/6392564 to your computer and use it in GitHub Desktop.
Unlike the assert() macro, abort_unless() is not disabled by defining the preprocessor macro NDEBUG.
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 abort_unless(expr) do { \ | |
if (!(expr)) { \ | |
fprintf(stderr, "%s:%u (%s): Assertion `%s' failed.\n", \ | |
__FILE__, __LINE__, __func__, __STRING(expr)); \ | |
fflush(stderr); \ | |
abort(); \ | |
} \ | |
} while (0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment