mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
942 B
52 lines
942 B
|
|
#ifndef __DEBUG_H
|
|
#define __DEBUG_H
|
|
|
|
#ifdef ASSERT
|
|
#undef ASSERT
|
|
#endif
|
|
|
|
#ifdef VERIFY
|
|
#undef VERIFY
|
|
#endif
|
|
|
|
int AssertFailedLine(LPCSTR lpszFileName, int nLine);
|
|
|
|
// determine number of elements in an array (not bytes)
|
|
void _Trace(LPCTSTR lpszFormat, ...);
|
|
|
|
#define _countof(array) (sizeof(array)/sizeof(array[0]))
|
|
|
|
#ifdef _UNICODE
|
|
#ifndef UNICODE
|
|
#define UNICODE // UNICODE is used by Windows headers
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef UNICODE
|
|
#ifndef _UNICODE
|
|
#define _UNICODE // _UNICODE is used by STR
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef DBG
|
|
|
|
#define THIS_FILE __FILE__
|
|
#define TRACE ::_Trace
|
|
|
|
#define ASSERT(f) \
|
|
do \
|
|
{ \
|
|
if (!(f)&& AssertFailedLine(THIS_FILE, __LINE__)) \
|
|
DebugBreak(); \
|
|
} while (0)
|
|
|
|
#define VERIFY(f) ASSERT(f)
|
|
#else
|
|
#define TRACE
|
|
#define ASSERT(f) ((void)0)
|
|
#define VERIFY(f) ((void)(f))
|
|
#endif
|
|
|
|
BOOL _IsValidAddress(const void* lp, UINT nBytes, BOOL bReadWrite = TRUE);
|
|
#endif
|