Mercurial > mplayer.hg
annotate loader/wine/debugtools.h @ 25794:2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
capital letter are reserved for the system, those starting with _ are
reserved at the file level.
author | diego |
---|---|
date | Sun, 20 Jan 2008 17:16:39 +0000 |
parents | c98c9e7f3bd0 |
children | 3aa3b6f0c4e3 |
rev | line source |
---|---|
1 | 1 |
24422
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
2 #ifndef WINE_DEBUGTOOLS_H |
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
3 #define WINE_DEBUGTOOLS_H |
1 | 4 |
5 #include <stdarg.h> | |
6 #include "config.h" | |
7 #include "windef.h" | |
8 | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
9 struct GUID; |
1 | 10 |
11 /* Internal definitions (do not use these directly) */ | |
12 | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
13 enum DEBUG_CLASS { DBCL_FIXME, DBCL_ERR, DBCL_WARN, DBCL_TRACE, DBCL_COUNT }; |
1 | 14 |
15 #ifndef NO_TRACE_MSGS | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
16 # define GET_DEBUGGING_trace(dbch) ((dbch)[0] & (1 << DBCL_TRACE)) |
1 | 17 #else |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
18 # define GET_DEBUGGING_trace(dbch) 0 |
1 | 19 #endif |
20 | |
21 #ifndef NO_DEBUG_MSGS | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
22 # define GET_DEBUGGING_warn(dbch) ((dbch)[0] & (1 << DBCL_WARN)) |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
23 # define GET_DEBUGGING_fixme(dbch) ((dbch)[0] & (1 << DBCL_FIXME)) |
1 | 24 #else |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
25 # define GET_DEBUGGING_warn(dbch) 0 |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
26 # define GET_DEBUGGING_fixme(dbch) 0 |
1 | 27 #endif |
28 | |
29 /* define error macro regardless of what is configured */ | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
30 #define GET_DEBUGGING_err(dbch) ((dbch)[0] & (1 << DBCL_ERR)) |
1 | 31 |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
32 #define GET_DEBUGGING(dbcl,dbch) GET_DEBUGGING_##dbcl(dbch) |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
33 #define SET_DEBUGGING(dbcl,dbch,on) \ |
1 | 34 ((on) ? ((dbch)[0] |= 1 << (dbcl)) : ((dbch)[0] &= ~(1 << (dbcl)))) |
35 | |
36 #ifndef __GNUC__ | |
37 #define __FUNCTION__ "" | |
38 #endif | |
39 | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
40 // illegal identifier |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
41 #define DPRINTF__(dbcl,dbch) \ |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
42 (!GET_DEBUGGING(dbcl,(dbch)) || (dbg_header_##dbcl((dbch),__FUNCTION__),0)) ? \ |
1 | 43 (void)0 : (void)dbg_printf |
44 | |
45 /* Exported definitions and macros */ | |
46 | |
47 /* These function return a printable version of a string, including | |
48 quotes. The string will be valid for some time, but not indefinitely | |
49 as strings are re-used. */ | |
50 extern LPCSTR debugstr_an (LPCSTR s, int n); | |
51 extern LPCSTR debugstr_wn (LPCWSTR s, int n); | |
52 extern LPCSTR debugres_a (LPCSTR res); | |
53 extern LPCSTR debugres_w (LPCWSTR res); | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
54 extern LPCSTR debugstr_guid( const struct GUID *id ); |
1 | 55 extern LPCSTR debugstr_hex_dump (const void *ptr, int len); |
56 extern int dbg_header_err( const char *dbg_channel, const char *func ); | |
57 extern int dbg_header_warn( const char *dbg_channel, const char *func ); | |
58 extern int dbg_header_fixme( const char *dbg_channel, const char *func ); | |
59 extern int dbg_header_trace( const char *dbg_channel, const char *func ); | |
60 extern int dbg_vprintf( const char *format, va_list args ); | |
61 | |
62 static inline LPCSTR debugstr_a( LPCSTR s ) { return debugstr_an( s, 80 ); } | |
63 static inline LPCSTR debugstr_w( LPCWSTR s ) { return debugstr_wn( s, 80 ); } | |
64 | |
65 #ifdef __GNUC__ | |
66 extern int dbg_printf(const char *format, ...) __attribute__((format (printf,1,2))); | |
67 #else | |
68 extern int dbg_printf(const char *format, ...); | |
69 #endif | |
70 | |
71 #define TRACE_(X) TRACE | |
72 #define WARN_(X) TRACE | |
73 #define WARN TRACE | |
74 #define ERR_(X) printf | |
75 #define ERR printf | |
76 #define FIXME_(X) TRACE | |
77 #define FIXME TRACE | |
78 | |
79 #define TRACE_ON(X) 1 | |
80 #define ERR_ON(X) 1 | |
81 | |
82 #define DECLARE_DEBUG_CHANNEL(ch) \ | |
83 extern char dbch_##ch[]; | |
84 #define DEFAULT_DEBUG_CHANNEL(ch) \ | |
85 extern char dbch_##ch[]; static char * const __dbch_default = dbch_##ch; | |
86 | |
87 #define DPRINTF dbg_printf | |
88 #define MESSAGE dbg_printf | |
89 | |
24422
c98c9e7f3bd0
Remove leading underscores from multiple inclusion guards,
diego
parents:
23430
diff
changeset
|
90 #endif /* WINE_DEBUGTOOLS_H */ |