home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / MONTE.ZIP / PMTHREAD / PMASSERT.H < prev    next >
Text File  |  1993-02-22  |  536b  |  18 lines

  1. // pmassert.h
  2. #ifndef NDEBUG
  3. #define pmassert(hab,exp)\
  4. {\
  5. if(!(exp)) {\
  6.   char ebuff[ 64 ]; unsigned long errorid; unsigned short shortrc;\
  7.   errorid = WinGetLastError( hab ); \
  8.   sprintf( ebuff, "Line %d\nFile %s\nLast Error %p\nExpression %s\n",\
  9.                  __LINE__, __FILE__, errorid, #exp );\
  10.   shortrc = WinMessageBox( HWND_DESKTOP, HWND_DESKTOP, ebuff,\
  11.                  "Assertion failed. Continue?", 0, MB_YESNO  );\
  12.   if( shortrc == MBID_NO ) exit( 1 );\
  13. }\
  14. }
  15. #else
  16.   #define pmassert(hab,exp)
  17. #endif
  18.