home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / directx / dsshow / wassert.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-15  |  834 b   |  29 lines

  1. /*==========================================================================
  2.  *
  3.  *  Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
  4.  *
  5.  *  File:        wassert.h
  6.  *  Content:    assert header
  7.  *
  8.  ***************************************************************************/
  9. #ifndef __WASSERT_INCLUDED__
  10. #define __WASSERT_INCLUDED__
  11.  
  12. #ifdef _DEBUG
  13. #define ASSERT        // Enable the Assert() macro
  14. #endif
  15.  
  16. #ifdef ASSERT
  17.  
  18. void AssertFail(char [], char [], int, char[]);
  19. #define Assert(f) ((f) ? (void)NULL : (void)AssertFail(#f, __FILE__, __LINE__,NULL))
  20. #define AssertMessage(f, szMessage) ((f) ? (void)NULL : (void)AssertFail(#f, __FILE__, __LINE__, szMessage))
  21.  
  22. #else
  23. #define Assert(f) (void)NULL        // Macro that does nothing
  24. #define AssertMessage(f, szMessage) (void)NULL    
  25.  
  26. #endif // ~ASSERT
  27.  
  28. #endif
  29.