home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / Util / Assert.h < prev    next >
C/C++ Source or Header  |  2000-06-03  |  700b  |  31 lines

  1. //
  2. //  $Id: Assert.h,v 1.1.1.1 2000/06/02 22:23:02 sergey Exp $
  3. //
  4.  
  5. #ifndef _Assert_h_
  6. #define _Assert_h_
  7.  
  8.  
  9. #ifdef DEBUG
  10.  
  11. namespace Util
  12. {
  13.     void DebugMessage(const char* file, int line, const char* format, ...);
  14.     void DebugPrintf(const char* format, ...);
  15. }
  16.  
  17. #define assert(cond) \
  18.     ((cond)? (void)0 : Util::DebugMessage(__FILE__, __LINE__, "Assertion failed: " #cond))
  19.  
  20. #define assertf(cond, format, args...) \
  21.     ((cond)? (void)0 : Util::DebugMessage(__FILE__, __LINE__, (format), ##args))
  22.  
  23. #else   // DEBUG
  24.  
  25. #define assert(cond)                        ((void)0)
  26. #define assertf(cond, format, args...)      ((void)0)
  27.  
  28. #endif  // DEBUG
  29.  
  30. #endif  // _Assert_h_
  31.