2000-09-17 09:36:01 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS WinSock 2 DLL
|
|
|
|
* FILE: include/debug.h
|
|
|
|
* PURPOSE: Debugging support macros
|
|
|
|
* DEFINES: DBG - Enable debug output
|
|
|
|
* NASSERT - Disable assertions
|
|
|
|
*/
|
|
|
|
#ifndef __DEBUG_H
|
|
|
|
#define __DEBUG_H
|
|
|
|
|
|
|
|
#define NORMAL_MASK 0x000000FF
|
|
|
|
#define SPECIAL_MASK 0xFFFFFF00
|
|
|
|
#define MIN_TRACE 0x00000001
|
|
|
|
#define MID_TRACE 0x00000002
|
|
|
|
#define MAX_TRACE 0x00000003
|
|
|
|
|
2001-05-01 22:44:07 +00:00
|
|
|
#define DEBUG_CHECK 0x00000100
|
2000-09-17 09:36:01 +00:00
|
|
|
#define DEBUG_ULTRA 0xFFFFFFFF
|
|
|
|
|
2003-05-28 Casper S. Hornstrup <chorns@users.sourceforge.net>
Changes for compiling with w32api
* include/ddk/haltypes.h: Move ...
* include/ntos/haltypes.h: ... here.
* include/ddk/obtypes.h: Move ...
* include/ntos/obtypes.h: ... here.
* include/ddk/i386/tss.h: Move ...
* include/ntos/tss.h: ... here.
* include/errors.h, include/windows.h: #include_next <windows.h>.
* include/ntos.h: Include "ntos/haltypes.h", "ntos/obtypes.h", and
"ntos/tss.h".
* include/ddk/defines.h (EXPORTED, IMPORTED): Move to
include/ntos/types.h.
* include/ddk/exfuncs.h, include/ddk/mmtypes.h, include/ntos/except.h,
include/ntos/file.h, include/ole32/guiddef.h, include/win32k/color.h,
lib/msafd/include/debug.h, lib/user32/include/debug.h,
lib/ws2_32/include/debug.h, lib/ws2help/debug.h,
ntoskrnl/include/internal/debug.h, ntoskrnl/ke/i386/bthread.S,
ntoskrnl/rtl/error.c: Don't define macros if previously defined.
* include/ddk/halfuncs.h: Include <ntos/haltypes.h>.
* include/ddk/iotypes.h: Include <ntos/obtypes.h>.
* include/ddk/ketypes.h (MB_FLAGS_*, LOADER_MODULE, ADDRESS_RANGE,
LOADER_PARAMETER_BLOCK): Move to include/ntos/types.h.
* include/ddk/ntddk.h: #include_next <ddk/ntddk.h>.
* include/ddk/ntifs.h: #include_next <ddk/ntifs.h>.
* include/napi/shared_data.h (SharedUserData): Undefine before defining.
* include/ntos/rtl.h (RtlUpcaseUnicodeString): Correct prototype.
* include/ntos/zwtypes.h (THREAD_STATE): Add.
* lib/ntdll/rtl/unicode.c (RtlUpcaseUnicodeString): Match new prototype.
* ntoskrnl/rtl/unicode.c (RtlUpcaseUnicodeString): Ditto.
* lib/string/Makefile: Include Makefile.$(ARCH). Don't include
makefile.$(ARCH).
* ntoskrnl/ex/sysinfo.c, ntoskrnl/include/internal/ntoskrnl.h,
* ntoskrnl/include/internal/ob.h, ntoskrnl/ob/handle.c: Include <ntos.h>.
* ntoskrnl/ke/i386/syscall.S: Don't include <ddk/defines.h>.
(KernelMode, UserMode): Define.
* ntoskrnl/ke/i386/stkswitch.S, ntoskrnl/ke/i386/tskswitch.S,
ntoskrnl/ke/i386/v86m_sup.S: Include <ntos/tss.h>
svn path=/trunk/; revision=4789
2003-05-28 18:09:10 +00:00
|
|
|
#ifdef ASSERT
|
|
|
|
#undef ASSERT
|
|
|
|
#endif
|
|
|
|
|
2009-06-17 12:44:05 +00:00
|
|
|
#if DBG
|
2000-09-17 09:36:01 +00:00
|
|
|
|
|
|
|
extern DWORD DebugTraceLevel;
|
|
|
|
|
|
|
|
#define WS_DbgPrint(_t_, _x_) \
|
|
|
|
if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
|
|
|
|
((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
|
2001-01-14 17:44:38 +00:00
|
|
|
DbgPrint("(%hS:%d)(%hS) ", __FILE__, __LINE__, __FUNCTION__); \
|
|
|
|
DbgPrint _x_; \
|
2000-09-17 09:36:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef NASSERT
|
|
|
|
#define ASSERT(x)
|
|
|
|
#else /* NASSERT */
|
2001-06-22 12:19:45 +00:00
|
|
|
#define ASSERT(x) if (!(x)) { WS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); }
|
2000-09-17 09:36:01 +00:00
|
|
|
#endif /* NASSERT */
|
|
|
|
|
|
|
|
#else /* DBG */
|
|
|
|
|
|
|
|
#define WS_DbgPrint(_t_, _x_)
|
|
|
|
|
|
|
|
#define ASSERT_IRQL(x)
|
|
|
|
#define ASSERT(x)
|
|
|
|
|
|
|
|
#endif /* DBG */
|
|
|
|
|
2002-09-08 10:23:54 +00:00
|
|
|
|
2000-09-17 09:36:01 +00:00
|
|
|
#define assert(x) ASSERT(x)
|
|
|
|
#define assert_irql(x) ASSERT_IRQL(x)
|
|
|
|
|
|
|
|
|
|
|
|
#define UNIMPLEMENTED \
|
|
|
|
WS_DbgPrint(MIN_TRACE, ("is unimplemented, please try again later.\n"));
|
|
|
|
|
|
|
|
#define CHECKPOINT \
|
2001-05-01 22:44:07 +00:00
|
|
|
WS_DbgPrint(DEBUG_CHECK, ("\n"));
|
2001-01-14 17:44:38 +00:00
|
|
|
|
|
|
|
#define CP CHECKPOINT
|
2000-09-17 09:36:01 +00:00
|
|
|
|
|
|
|
#endif /* __DEBUG_H */
|
|
|
|
|
|
|
|
/* EOF */
|