00001 00011 #ifndef __PUTTY_ASSERT_H__ 00012 #define __PUTTY_ASSERT_H__ 00013 00014 #ifdef __cplusplus 00015 extern "C" { 00016 #endif 00017 00018 #define DO_ASSERT_ALWAYS 00019 00028 #if defined(NDEBUG) && !defined(DO_ASSERT_ALWAYS) 00029 #define assert(e) ( ) 00030 #else 00031 #define assert(e) ((e) ? (void)0 : assert_failed(__FILE__, __LINE__, #e)) 00032 #endif 00033 00034 void assert_failed(const char *file, int line, const char *expr); 00035 00036 #ifdef __cplusplus 00037 } 00038 #endif 00039 00040 00041 #endif