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 / dsstream / wassert.h < prev   
C/C++ Source or Header  |  1997-07-14  |  919b  |  37 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 WASSERT          // Enable the Assert() macro
  14. #endif
  15.  
  16. #ifdef WASSERT
  17.  
  18. #ifdef _cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. void AssertFail(char [], char [], int, char[]);
  23. #define Assert(f) ((f) ? (void)NULL : (void)AssertFail(#f, __FILE__, __LINE__,NULL))
  24. #define AssertMessage(f, szMessage) ((f) ? (void)NULL : (void)AssertFail(#f, __FILE__, __LINE__, szMessage))
  25.  
  26. #else
  27. #define Assert(f) (void)NULL        // Macro that does nothing
  28. #define AssertMessage(f, szMessage) (void)NULL    
  29.  
  30. #ifdef _cplusplus
  31. };
  32. #endif
  33.  
  34. #endif // ~ASSERT
  35.  
  36. #endif
  37.