Skip to content

Instantly share code, notes, and snippets.

@sirwolfgang
Created March 3, 2013 03:51
Show Gist options
  • Save sirwolfgang/5074422 to your computer and use it in GitHub Desktop.
Save sirwolfgang/5074422 to your computer and use it in GitHub Desktop.
Custom Asserts
#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