6 * This file is part of the ReactOS Operating System.
9 * Created by KJK::Hyperion <noog@libero.it>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 #ifndef __PSX_DEBUG_H_INCLUDED__
23 #define __PSX_DEBUG_H_INCLUDED__
26 #ifdef __PSX_DEBUG_TO_STDERR__
28 #else /* !defined(__PSX_DEBUG_TO_STDERR__) */
29 #include <ddk/ntddk.h>
30 #endif /* defined(__PSX_DEBUG_TO_STDERR__) */
42 #define __PSX_MODULE__ "psxdll.dll"
46 #ifdef __PSX_DEBUG_TO_STDERR__
49 #define DEBUGOUT(MODULE,TYPE,ARGS...) \
51 fprintf(stderr,"%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
52 fprintf(stderr,ARGS); \
58 #define DEBUGOUT(MODULE,TYPE,ARGS...) \
60 printf("%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
67 #else /* !defined(__PSX_DEBUG_TO_STDERR__) */
69 #define DEBUGOUT(MODULE,TYPE,ARGS...) \
71 DbgPrint("%s:%s:%s:%d:%s():\n\t",(MODULE),(TYPE),__FILE__,__LINE__,__FUNCTION__); \
77 #endif /* defined(__PSX_DEBUG_TO_STDERR__) */
79 #define DEBUGOUTIF(CONDITION,MODULE,TYPE,ARGS...) \
82 DEBUGOUT((MODULE),(TYPE),ARGS); \
85 #else /* defined(NDEBUG) */
87 #define DEBUGOUTIF(c,m,t,args...)
88 #define DEBUGOUT(m,t,args...)
90 #endif /* !defined(NDEBUG) */
92 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_HINTS__)
93 #define HINT(args...) DEBUGOUT(__PSX_MODULE__,"HINT",args)
94 #define HINTIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"HINT",args)
97 #define HINTIF(c,args...)
100 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_INFOS__)
101 #define INFO(args...) DEBUGOUT(__PSX_MODULE__,"INFO",args)
102 #define INFOIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"INFO",args)
104 #define INFO(args...)
105 #define INFOIF(c,args...)
108 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_WARNS__)
109 #define WARN(args...) DEBUGOUT(__PSX_MODULE__,"WARN",args)
110 #define WARNIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"WARN",args)
112 #define WARN(args...)
113 #define WARNIF(c,args...)
116 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_ERRS__)
117 #define ERR(args...) DEBUGOUT(__PSX_MODULE__,"ERR",args)
118 #define ERRIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"ERR",args)
121 #define ERRIF(c,args...)
124 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_TODOS__)
125 #define TODO(args...) DEBUGOUT(__PSX_MODULE__,"TODO",args)
126 #define TODOIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"TODO",args)
128 #define TODO(args...)
129 #define TODOIF(c,args...)
132 #if defined(__PSX_DEBUG_WANT_ALL__) || defined(__PSX_DEBUG_WANT_FIXMES__)
133 #define FIXME(args...) DEBUGOUT(__PSX_MODULE__,"FIXME",args)
134 #define FIXMEIF(c,args...) DEBUGOUTIF((c),__PSX_MODULE__,"FIXME",args)
136 #define FIXME(args...)
137 #define FIXMEIF(c,args...)
141 #endif /* __PSX_DEBUG_H_INCLUDED__ */