home *** CD-ROM | disk | FTP | other *** search
- /*
- * Debug.h
- * $Header: /bcsample/BUGBNCHX/MAINERR/DEBUG.H 1 5/28/96 1:11p Dave $
- *
- * Description:
- * Diagnostic support routines
- *
- * Notes:
- * Much of the implementation was taken from the Win32
- * sample, MCITEST.
- *
- ***********************************************************************
- *
- * Nu-Mega Technologies, Inc.
- * P.O. Box 7780
- * Nashua, NH 03060
- *
- * (c) Copyright 1994, 1995 Nu-Mega Technologies, Inc.
- * ALL RIGHTS RESERVED.
- *
- ***********************************************************************
- *
- **********************************************************************/
-
- #ifndef __DEBUG_H__
- #define __DEBUG_H__
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #ifdef _DEBUG
-
- extern void dDbgOut ( LPTSTR lpszFormat, ... );
- extern void dDbgAssert ( LPTSTR szExp , LPTSTR szFile , int nLine );
-
- extern DWORD __dwEval;
-
- #define dprintf( _x_ ) dDbgOut _x_
- #define dprintf1( _x_ ) dDbgOut _x_
- #define dprintf2( _x_ ) dDbgOut _x_
- #define dprintf3( _x_ ) dDbgOut _x_
-
- #define WinAssert(exp) \
- ((exp) ? (void)0 : dDbgAssert(#exp, __FILE__, __LINE__))
-
- #define WinEval(exp) \
- ((__dwEval=(DWORD)(exp)), \
- __dwEval ? (void)0 : dDbgAssert(#exp, __FILE__, __LINE__), __dwEval)
-
- // Provide MFC-like diagnostic support
- #define ASSERT(exp) WinAssert(exp)
- #define VERIFY(exp) WinEval(exp)
- #define TRACE( _x_ ) dprintf( (_x_) )
- #define TRACE1( _x_ , p ) dprintf1( (_x_ , p) )
- #define TRACE2( _x_ , p1 , p2 ) dprintf2( (_x_ , p1 , p2) )
- #define TRACE3( _x_ , p1 , p2 , p3 ) dprintf3( (_x_ , p1 , p2 , p3) )
-
- #else
-
- #define dprintf( _x_ )
- #define dprintf1( _x_ )
- #define dprintf2( _x_ )
- #define dprintf3( _x_ )
- #define dprintf4( _x_ )
-
- #define WinAssert(exp) 0
- #define WinEval(exp) (exp)
-
- #define ASSERT(exp) WinAssert(exp)
- #define VERIFY(exp) WinEval(exp)
- #define TRACE( _x_ ) dprintf( (_x_) )
- #define TRACE1( _x_ , p ) dprintf1( (_x_ , p) )
- #define TRACE2( _x_ , p1 , p2 ) dprintf2( (_x_ , p1 , p2) )
- #define TRACE3( _x_ , p1 , p2 , p3 ) dprintf3( (_x_ , p1 , p2 , p3) )
-
- #endif
-
-
- #ifdef __cplusplus
- }
- #endif
-
-
- #endif // __DEBUG_H__
-