1 /* $Id: debug.h,v 1.4 2002/10/29 04:45:11 rex Exp $
8 * This file is part of the ReactOS Operating System.
11 * Created by KJK::Hyperion <noog@libero.it>
13 * THIS SOFTWARE IS NOT COPYRIGHTED
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
18 * This code is distributed in the hope that it will be useful but
19 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20 * DISCLAMED. This includes but is not limited to warranties of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 #ifndef __PSX_DEBUG_H_INCLUDED__
25 #define __PSX_DEBUG_H_INCLUDED__
28 #ifdef __PSX_DEBUG_TO_STDERR__
30 #else /* !defined(__PSX_DEBUG_TO_STDERR__) */
31 #include <ddk/ntddk.h>
32 #endif /* defined(__PSX_DEBUG_TO_STDERR__) */
44 #define __PSX_MODULE__ "psxdll.dll"
48 #ifdef __PSX_DEBUG_TO_STDERR__
51 #define DEBUGOUT(MODULE,TYPE,ARGS...) \
53 fprintf(stderr,"%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
54 fprintf(stderr,ARGS); \
60 #define DEBUGOUT(MODULE,TYPE,ARGS...) \
62 printf("%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
69 #else /* !defined(__PSX_DEBUG_TO_STDERR__) */
71 #define DEBUGOUT(MODULE,TYPE,ARGS...) \
73 DbgPrint("%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
79 #endif /* defined(__PSX_DEBUG_TO_STDERR__) */
81 #define DEBUGOUTIF(CONDITION,MODULE,TYPE,ARGS...) \
84 DEBUGOUT((MODULE),(TYPE),ARGS); \
87 #else /* defined(NDEBUG) */
89 #define DEBUGOUTIF(c,m,t,args...)
90 #define DEBUGOUT(m,t,args...)
92 #endif /* !defined(NDEBUG) */
94 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_HINTS__)
95 #define HINT(args...) DEBUGOUT(__PSX_MODULE__,"HINT",args)
96 #define HINTIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"HINT",args)
99 #define HINTIF(c,args...)
102 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_INFOS__)
103 #define INFO(args...) DEBUGOUT(__PSX_MODULE__,"INFO",args)
104 #define INFOIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"INFO",args)
106 #define INFO(args...)
107 #define INFOIF(c,args...)
110 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_WARNS__)
111 #define WARN(args...) DEBUGOUT(__PSX_MODULE__,"WARN",args)
112 #define WARNIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"WARN",args)
114 #define WARN(args...)
115 #define WARNIF(c,args...)
118 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_ERRS__)
119 #define ERR(args...) DEBUGOUT(__PSX_MODULE__,"ERR",args)
120 #define ERRIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"ERR",args)
123 #define ERRIF(c,args...)
126 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_TODOS__)
127 #define TODO(args...) DEBUGOUT(__PSX_MODULE__,"TODO",args)
128 #define TODOIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"TODO",args)
130 #define TODO(args...)
131 #define TODOIF(c,args...)
134 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_FIXMES__)
135 #define FIXME(args...) DEBUGOUT(__PSX_MODULE__,"FIXME",args)
136 #define FIXMEIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"FIXME",args)
138 #define FIXME(args...)
139 #define FIXMEIF(c,args...)
143 #endif /* __PSX_DEBUG_H_INCLUDED__ */