home *** CD-ROM | disk | FTP | other *** search
/ s-gikan2.maizuru-ct.ac.jp / s-gikan2.maizuru-ct.ac.jp.zip / s-gikan2.maizuru-ct.ac.jp / pub / magdb142.lzh / MagaDbgMac.h < prev    next >
C/C++ Source or Header  |  1999-10-05  |  1KB  |  50 lines

  1. /*
  2.     MagaDebug32 âfâoâbâOâcü[âï Ver1.41
  3.     â}âNâìâwâbâ_ü[âtâ@âCâï
  4.     üiébü^ébü{ü{ïñÆ╩üj
  5. */
  6. #if !defined(___MAGADBGMACRO_H)
  7. #define    ___MAGADBGMACRO_H
  8.  
  9. #if /* defined(_DEBUG) && */ !defined(___MAGADBGCLASS_H)
  10. #include "MagaDbg.h"
  11. #endif
  12.  
  13. #if defined(_DEBUG)
  14.  
  15. #if defined(__cplusplus)
  16.  
  17.     static    CMagaDbg    ___MagaDbg("DBGASSERT", DBG_RED);
  18.     #define DBGASSERT(expr, str) \
  19.         if ( !(expr) ) \
  20.             ___MagaDbg.printf("%s(%04d):%s", __FILE__, __LINE__, (str));
  21.     #define    DBGBOOL(OBJ, str, expr) \
  22.         OBJ.printf("%s = %s", (str), (expr) ? "TRUE" : "FALSE");
  23.     #define DBGPARAM(OBJ, param) \
  24.         OBJ.printf("HIWORD=%04X LOWORD=%04X", HIWORD(param), LOWORD(param));
  25.  
  26. #else
  27.  
  28.     #define DBGASSERT(expr, str) \
  29.         if ( !(expr) ) \
  30.             Dbg_printf("DBGASSERT:%s(%04d):%s", __FILE__, __LINE__, (str));
  31.     #define    DBGBOOL(str, expr) \
  32.         Dbg_printf("%s = %s", (str), (expr) ? "TRUE" : "FALSE");
  33.     #define DBGPARAM(param) \
  34.         Dbg_printf("HIWORD=%04X LOWORD=%04X", HIWORD(param), LOWORD(param));
  35.  
  36. #endif
  37.  
  38. #else    /* Release version */
  39.  
  40. #define DBGASSERT(expr, str)
  41. #if defined(__cplusplus)
  42.     #define    DBGBOOL(OBJ, str, expr)
  43. #else
  44.     #define    DBGBOOL(str, expr)
  45. #endif
  46.  
  47. #endif
  48.  
  49. #endif
  50.