Listing 5 A simple implementation of the assert macro

/* assert.h */

extern void __assert(char *, char *, long);

#undef assert
#ifdef NDEBUG
#define assert(cond)
   (void) 0
#else

#define assert(cond) \
   ((cond)          \
     ? (void)  0    \
     : __assert(#cond,__FILE__,__LINE__))
/* End of File */