home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-1.ZIP / CLASSINC.ZIP / CHECKS.H < prev    next >
C/C++ Source or Header  |  1992-02-18  |  2KB  |  47 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  CHECKS.H                                                              */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991                                  */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( __CHECKS_H )
  11. #define __CHECKS_H
  12.  
  13. #if !defined( ___DEFS_H )
  14. #include <_defs.h>
  15. #endif  // ___DEFS_H
  16.  
  17. extern "C" void _Cdecl __assertfail( char _FAR *__msg,
  18.                                      char _FAR *__cond,
  19.                                      char _FAR *__file,
  20.                                      int __line);
  21.  
  22. #if !defined( __DEBUG )
  23. #define __DEBUG 2
  24. #endif
  25.  
  26. #undef PRECONDITION
  27.  
  28. #if __DEBUG < 1
  29. #define PRECONDITION(p)   ((void)0)
  30. #else
  31. #define PRECONDITION(p)   ((p) ? (void)0 : (void) __assertfail(      \
  32.                     "Precondition violated: %s, file %s, line %d\n", \
  33.                     #p, __FILE__, __LINE__ ) )
  34. #endif
  35.  
  36. #undef CHECK
  37.  
  38. #if __DEBUG < 2
  39. #define CHECK(p)    ((void)0)
  40. #else
  41. #define CHECK(p)    ((p) ? (void)0 : (void) __assertfail(   \
  42.                     "Check failed: %s, file %s, line %d\n", \
  43.                     #p, __FILE__, __LINE__ ) )
  44. #endif
  45.  
  46. #endif  // __CHECKS_H
  47.