9f9891a144eb43658bc83f6946910fce6ea78495
[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 <windows.h>
7 #include <wchar.h>
8
9 /* Add ROS Master debug functions if not added yet */
10 #ifndef __INTERNAL_DEBUG
11 #include <reactos/debug.h>
12 #endif
13
14 #ifndef __GNUC__
15 #define __FUNCTION__ ""
16 #define inline __inline
17 #endif
18
19 unsigned long DbgPrint(char *Format,...);
20
21 struct _GUID;
22
23 /* Exported definitions and macros */
24
25 /* These function return a printable version of a string, including
26 quotes. The string will be valid for some time, but not indefinitely
27 as strings are re-used. */
28 extern const char *wine_dbgstr_w( const WCHAR *s );
29 extern const char *wine_dbgstr_an( const char * s, int n );
30 extern const char *wine_dbgstr_wn( const wchar_t *s, int n );
31 extern const char *wine_dbgstr_guid( const struct _GUID *id );
32 extern const char *wine_dbgstr_longlong( unsigned long long ll );
33 extern const char *wine_dbg_sprintf( const char *format, ... );
34
35 inline static const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); }
36 inline static const char *debugstr_wn( const wchar_t *s, int n ) { return wine_dbgstr_wn( s, n ); }
37 inline static const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); }
38 inline static const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, 80 ); }
39 inline static const char *debugstr_w( const wchar_t *s ) { return wine_dbgstr_wn( s, 80 ); }
40 inline static const char *debugres_a( const char *s ) { return wine_dbgstr_an( s, 80 ); }
41 inline static const char *debugres_w( const wchar_t *s ) { return wine_dbgstr_wn( s, 80 ); }
42
43 static inline const char *wine_dbgstr_point( const POINT *pt )
44 {
45 if (!pt) return "(null)";
46 return wine_dbg_sprintf( "(%ld,%ld)", pt->x, pt->y );
47 }
48
49 static inline const char *wine_dbgstr_size( const SIZE *size )
50 {
51 if (!size) return "(null)";
52 return wine_dbg_sprintf( "(%ld,%ld)", size->cx, size->cy );
53 }
54
55 static inline const char *wine_dbgstr_rect( const RECT *rect )
56 {
57 if (!rect) return "(null)";
58 return wine_dbg_sprintf( "(%ld,%ld)-(%ld,%ld)", rect->left, rect->top, rect->right, rect->bottom );
59 }
60
61 #define TRACE DPRINT
62 #define TRACE_(ch) DPRINT
63 #ifdef NDEBUG
64 #define TRACE_ON(ch) 0
65 #else
66 #define TRACE_ON(ch) 1
67 #endif
68
69 #define WINE_TRACE DPRINT
70 #define WINE_TRACE_(ch) DPRINT
71 #ifdef NDEBUG
72 #define WINE_TRACE_ON(ch) 0
73 #else
74 #define WINE_TRACE_ON(ch) 1
75 #endif
76
77 #define WARN DPRINT
78 #define WARN_(ch) DPRINT
79 #ifdef NDEBUG
80 #define WARN_ON(ch) 0
81 #else
82 #define WARN_ON(ch) 1
83 #endif
84
85 #ifdef FIXME
86 #undef FIXME
87 #endif
88 #define FIXME DPRINT1
89 #define FIXME_(ch) DPRINT1
90 #ifdef NDEBUG
91 #define FIXME_ON(ch) 0
92 #else
93 #define FIXME_ON(ch) 1
94 #endif
95
96 #ifdef WINE_FIXME
97 #undef WINE_FIXME
98 #endif
99 #define WINE_FIXME DPRINT1
100 #define WINE_FIXME_(ch) DPRINT1
101 #ifdef NDEBUG
102 #define WINE_FIXME_ON(ch) 0
103 #else
104 #define WINE_FIXME_ON(ch) 1
105 #endif
106
107 #define ERR DPRINT1
108 #define ERR_(ch) DPRINT1
109 #ifdef NDEBUG
110 #define ERR_ON(ch) 0
111 #else
112 #define ERR_ON(ch) 1
113 #endif
114
115 #define WINE_ERR DPRINT1
116 #define WINE_ERR_(ch) DPRINT1
117 #ifdef NDEBUG
118 #define WINE_ERR_ON(ch) 0
119 #else
120 #define WINE_ERR_ON(ch) 1
121 #endif
122
123 #define DECLARE_DEBUG_CHANNEL(ch)
124 #define DEFAULT_DEBUG_CHANNEL(ch)
125
126 #define WINE_DECLARE_DEBUG_CHANNEL(ch) DECLARE_DEBUG_CHANNEL(ch)
127 #define WINE_DEFAULT_DEBUG_CHANNEL(ch) DEFAULT_DEBUG_CHANNEL(ch)
128
129 #define DPRINTF DPRINT
130 #define MESSAGE DPRINT
131
132 #endif /* __WINE_DEBUG_H */