Created
March 3, 2013 03:51
-
-
Save sirwolfgang/5074422 to your computer and use it in GitHub Desktop.
Custom Asserts
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
#include <cstdlib> | |
#undef assert | |
#ifndef PLATFORM_DEBUG | |
#define assert(_bCondition)\ | |
do\ | |
{\ | |
(void)sizeof(_bCondition);\ | |
}\ | |
while(0) | |
#else | |
#define assert(_bCondition)\ | |
do\ | |
{\ | |
if(!(_bCondition))\ | |
{\ | |
abort();\ | |
}\ | |
}\ | |
while(0) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment