Merge 15329:15546 from trunk
[reactos.git] / reactos / include / wine / debug.h
1 #ifndef __WINE_DEBUG_H
2 #define __WINE_DEBUG_H
3
4 #include "../roscfg.h"
5 #include <stdarg.h>
6 #include <wchar.h>
7
8 #ifndef __GNUC__
9 #define __FUNCTION__ ""
10 #define inline __inline
11 #endif
12
13 unsigned long DbgPrint(char *Format,...);
14
15 #ifdef DBG
16 #define DPRINT1 DbgPrint("(%s:%d:%s) ",__FILE__,__LINE__,__FUNCTION__), DbgPrint
17 #else
18 #define DPRINT1(args...)
19 #endif
20
21 #if !defined(DBG) || !defined(YDEBUG)
22 #ifdef __GNUC__
23 #define DPRINT(args...)
24 #else
25 #define DPRINT
26 #endif
27 #else
28 #define DPRINT DbgPrint("(%s:%d:%s) ",__FILE__,__LINE__,__FUNCTION__), DbgPrint
29 #endif
30
31 #define UNIMPLEMENTED DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__);
32
33
34 struct _GUID;
35
36 /* Exported definitions and macros */
37
38 /* These function return a printable version of a string, including
39 quotes. The string will be valid for some time, but not indefinitely
40 as strings are re-used. */
41 extern const char *wine_dbgstr_an( const char * s, int n );
42 extern const char *wine_dbgstr_wn( const wchar_t *s, int n );
43 extern const char *wine_dbgstr_guid( const struct _GUID *id );
44 extern const char *wine_dbgstr_longlong( unsigned long long ll );
45 extern const char *wine_dbg_sprintf( const char *format, ... );
46
47 inline static const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); }
48 inline static const char *debugstr_wn( const wchar_t *s, int n ) { return wine_dbgstr_wn( s, n ); }
49 inline static const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); }
50 inline static const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, 80 ); }
51 inline static const char *debugstr_w( const wchar_t *s ) { return wine_dbgstr_wn( s, 80 ); }
52 inline static const char *debugres_a( const char *s ) { return wine_dbgstr_an( s, 80 ); }
53 inline static const char *debugres_w( const wchar_t *s ) { return wine_dbgstr_wn( s, 80 ); }
54
55 #define TRACE DPRINT
56 #define TRACE_(ch) DPRINT
57 #ifdef NDEBUG
58 #define TRACE_ON(ch) 0
59 #else
60 #define TRACE_ON(ch) 1
61 #endif
62
63 #define WINE_TRACE DPRINT
64 #define WINE_TRACE_(ch) DPRINT
65 #ifdef NDEBUG
66 #define WINE_TRACE_ON(ch) 0
67 #else
68 #define WINE_TRACE_ON(ch) 1
69 #endif
70
71 #define WARN DPRINT
72 #define WARN_(ch) DPRINT
73 #ifdef NDEBUG
74 #define WARN_ON(ch) 0
75 #else
76 #define WARN_ON(ch) 1
77 #endif
78
79 #ifdef FIXME
80 #undef FIXME
81 #endif
82 #define FIXME DPRINT1
83 #define FIXME_(ch) DPRINT1
84 #ifdef NDEBUG
85 #define FIXME_ON(ch) 0
86 #else
87 #define FIXME_ON(ch) 1
88 #endif
89
90 #ifdef WINE_FIXME
91 #undef WINE_FIXME
92 #endif
93 #define WINE_FIXME DPRINT1
94 #define WINE_FIXME_(ch) DPRINT1
95 #ifdef NDEBUG
96 #define WINE_FIXME_ON(ch) 0
97 #else
98 #define WINE_FIXME_ON(ch) 1
99 #endif
100
101 #define ERR DPRINT1
102 #define ERR_(ch) DPRINT1
103 #ifdef NDEBUG
104 #define ERR_ON(ch) 0
105 #else
106 #define ERR_ON(ch) 1
107 #endif
108
109 #define WINE_ERR DPRINT1
110 #define WINE_ERR_(ch) DPRINT1
111 #ifdef NDEBUG
112 #define WINE_ERR_ON(ch) 0
113 #else
114 #define WINE_ERR_ON(ch) 1
115 #endif
116
117 #define DECLARE_DEBUG_CHANNEL(ch)
118 #define DEFAULT_DEBUG_CHANNEL(ch)
119
120 #define WINE_DECLARE_DEBUG_CHANNEL(ch) DECLARE_DEBUG_CHANNEL(ch)
121 #define WINE_DEFAULT_DEBUG_CHANNEL(ch) DEFAULT_DEBUG_CHANNEL(ch)
122
123 #define DPRINTF DPRINT
124 #define MESSAGE DPRINT
125
126 #endif /* __WINE_DEBUG_H */