00001
00002
00003
00004
00005
00006 #ifndef INET_ASSERT_H
00007 #define INET_ASSERT_H
00008
00009 #if !NDEBUG
00010
00011 void bad_assertion(char *file, int line, char *what) _NORETURN;
00012 void bad_compare(char *file, int line, int lhs, char *what, int rhs) _NORETURN;
00013
00014 #define assert(x) ((void)(!(x) ? bad_assertion(this_file, __LINE__, \
00015 #x),0 : 0))
00016 #define compare(a,t,b) (!((a) t (b)) ? bad_compare(this_file, __LINE__, \
00017 (a), #a " " #t " " #b, (b)) : (void) 0)
00018
00019 #else
00020
00021 #define assert(x) 0
00022 #define compare(a,t,b) 0
00023
00024 #endif
00025
00026 #endif
00027
00028
00029
00030
00031