home *** CD-ROM | disk | FTP | other *** search
/ NEXT Generation 27 / NEXT27.iso / pc / demos / emperor / dx3.exe / SDK / SAMPLES / DSSTREAM / WASSERT.H < prev   
C/C++ Source or Header  |  1996-08-28  |  946b  |  37 lines

  1. /*==========================================================================
  2.  *
  3.  *  Copyright (C) 1995-1996 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.