home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / thread2.zip / PMASSERT.H < prev    next >
Text File  |  1993-03-10  |  636b  |  21 lines

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