mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 01:46:21 +00:00
Add ERR_, WARN_, TRACE_ and INFO_ macros which call DbgPrintEx
svn path=/trunk/; revision=31216
This commit is contained in:
parent
0ae8ce587f
commit
927f7b56aa
1 changed files with 41 additions and 3 deletions
|
@ -21,11 +21,14 @@
|
||||||
#define CHECKED
|
#define CHECKED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define DbgPrint/RtlAssert unless the NDK is used */
|
/* Define DbgPrint/DbgPrintEx/RtlAssert unless the NDK is used */
|
||||||
#if !defined(_RTLFUNCS_H) && (!defined(_NTDDK_) || !defined(__NTDDK_H))
|
#if !defined(_RTLFUNCS_H) && (!defined(_NTDDK_) || !defined(__NTDDK_H))
|
||||||
|
|
||||||
/* Make sure we have basic types (some people include us *before* SDK... */
|
/* Make sure we have basic types (some people include us *before* SDK... */
|
||||||
#if defined(_NTDEF_) || (defined _WINDEF_) || (defined _WINDEF_H)
|
#if !defined(_NTDEF_) && !defined(_WINDEF_) && !defined(_WINDEF_H)
|
||||||
|
#error Please include SDK first.
|
||||||
|
#endif
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
__cdecl
|
__cdecl
|
||||||
DbgPrint(
|
DbgPrint(
|
||||||
|
@ -33,6 +36,15 @@ DbgPrint(
|
||||||
IN ...
|
IN ...
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
__cdecl
|
||||||
|
DbgPrintEx(
|
||||||
|
IN ULONG ComponentId,
|
||||||
|
IN ULONG Level,
|
||||||
|
IN PCCH Format,
|
||||||
|
IN ...
|
||||||
|
);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -42,7 +54,6 @@ RtlAssert(
|
||||||
ULONG LineNumber,
|
ULONG LineNumber,
|
||||||
PCHAR Message
|
PCHAR Message
|
||||||
);
|
);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -98,6 +109,28 @@ RtlAssert(
|
||||||
#define UNIMPLEMENTED \
|
#define UNIMPLEMENTED \
|
||||||
DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__);
|
DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__);
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#define ERR_(ch, args...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_ERROR_LEVEL, "(%s:%d)", __FILE__, __LINE__), \
|
||||||
|
DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_ERROR_LEVEL, ##args)
|
||||||
|
#define WARN_(ch, args...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_WARNING_LEVEL, "(%s:%d)", __FILE__, __LINE__), \
|
||||||
|
DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_WARNING_LEVEL, ##args)
|
||||||
|
#define TRACE_(ch, args...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_TRACE_LEVEL, "(%s:%d)", __FILE__, __LINE__), \
|
||||||
|
DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_TRACE_LEVEL, ##args)
|
||||||
|
#define INFO_(ch, args...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_INFO_LEVEL, "(%s:%d)", __FILE__, __LINE__), \
|
||||||
|
DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_INFO_LEVEL, ##args)
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define ERR_(ch, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_ERROR_LEVEL, "(%s:%d)", __FILE__, __LINE__), \
|
||||||
|
DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_ERROR_LEVEL, __VA_ARGS__)
|
||||||
|
#define WARN_(ch, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_WARNING_LEVEL, "(%s:%d)", __FILE__, __LINE__), \
|
||||||
|
DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_WARNING_LEVEL, __VA_ARGS__)
|
||||||
|
#define TRACE_(ch, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_TRACE_LEVEL, "(%s:%d)", __FILE__, __LINE__), \
|
||||||
|
DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_TRACE_LEVEL, __VA_ARGS__)
|
||||||
|
#define INFO_(ch, ...) DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_INFO_LEVEL, "(%s:%d)", __FILE__, __LINE__), \
|
||||||
|
DbgPrintEx(DPFLTR_##ch##_ID, DPFLTR_INFO_LEVEL, __VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#error Unknown compiler
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* On non-debug builds, we never show these */
|
/* On non-debug builds, we never show these */
|
||||||
|
@ -107,6 +140,11 @@ RtlAssert(
|
||||||
#define CHECKPOINT1
|
#define CHECKPOINT1
|
||||||
#define CHECKPOINT
|
#define CHECKPOINT
|
||||||
#define UNIMPLEMENTED
|
#define UNIMPLEMENTED
|
||||||
|
|
||||||
|
#define ERR_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
|
||||||
|
#define WARN_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
|
||||||
|
#define TRACE_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
|
||||||
|
#define INFO_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue