Mercurial > mplayer.hg
annotate loader/wine/debugtools.h @ 28980:90e69faca51d
Fix swscale compilation with Altivec enabled.
author | reimar |
---|---|
date | Fri, 20 Mar 2009 16:12:03 +0000 |
parents | 9e739bdb049c |
children |
rev | line source |
---|---|
26045 | 1 #ifndef MPLAYER_DEBUGTOOLS_H |
2 #define MPLAYER_DEBUGTOOLS_H | |
1 | 3 |
4 #include <stdarg.h> | |
5 #include "config.h" | |
6 #include "windef.h" | |
7 | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
8 struct GUID; |
1 | 9 |
10 /* Internal definitions (do not use these directly) */ | |
11 | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
12 enum DEBUG_CLASS { DBCL_FIXME, DBCL_ERR, DBCL_WARN, DBCL_TRACE, DBCL_COUNT }; |
1 | 13 |
14 #ifndef NO_TRACE_MSGS | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
15 # define GET_DEBUGGING_trace(dbch) ((dbch)[0] & (1 << DBCL_TRACE)) |
1 | 16 #else |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
17 # define GET_DEBUGGING_trace(dbch) 0 |
1 | 18 #endif |
19 | |
20 #ifndef NO_DEBUG_MSGS | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
21 # 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
|
22 # define GET_DEBUGGING_fixme(dbch) ((dbch)[0] & (1 << DBCL_FIXME)) |
1 | 23 #else |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
24 # define GET_DEBUGGING_warn(dbch) 0 |
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
25 # define GET_DEBUGGING_fixme(dbch) 0 |
1 | 26 #endif |
27 | |
28 /* 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
|
29 #define GET_DEBUGGING_err(dbch) ((dbch)[0] & (1 << DBCL_ERR)) |
1 | 30 |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
31 #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
|
32 #define SET_DEBUGGING(dbcl,dbch,on) \ |
1 | 33 ((on) ? ((dbch)[0] |= 1 << (dbcl)) : ((dbch)[0] &= ~(1 << (dbcl)))) |
34 | |
35 /* Exported definitions and macros */ | |
36 | |
37 /* These function return a printable version of a string, including | |
38 quotes. The string will be valid for some time, but not indefinitely | |
39 as strings are re-used. */ | |
28051 | 40 LPCSTR debugstr_an( LPCSTR s, int n ); |
41 LPCSTR debugstr_wn( LPCWSTR s, int n ); | |
42 LPCSTR debugres_a( LPCSTR res ); | |
43 LPCSTR debugres_w( LPCWSTR res ); | |
44 LPCSTR debugstr_guid( const struct GUID *id ); | |
45 LPCSTR debugstr_hex_dump( const void *ptr, int len ); | |
46 int dbg_header_err( const char *dbg_channel, const char *func ); | |
47 int dbg_header_warn( const char *dbg_channel, const char *func ); | |
48 int dbg_header_fixme( const char *dbg_channel, const char *func ); | |
49 int dbg_header_trace( const char *dbg_channel, const char *func ); | |
50 int dbg_vprintf( const char *format, va_list args ); | |
1 | 51 |
52 static inline LPCSTR debugstr_a( LPCSTR s ) { return debugstr_an( s, 80 ); } | |
53 static inline LPCSTR debugstr_w( LPCWSTR s ) { return debugstr_wn( s, 80 ); } | |
54 | |
55 #define TRACE_(X) TRACE | |
56 #define WARN_(X) TRACE | |
57 #define WARN TRACE | |
58 #define ERR_(X) printf | |
59 #define ERR printf | |
60 #define FIXME_(X) TRACE | |
61 #define FIXME TRACE | |
62 | |
63 #define TRACE_ON(X) 1 | |
64 #define ERR_ON(X) 1 | |
65 | |
66 #define DECLARE_DEBUG_CHANNEL(ch) \ | |
67 extern char dbch_##ch[]; | |
68 #define DEFAULT_DEBUG_CHANNEL(ch) \ | |
69 extern char dbch_##ch[]; static char * const __dbch_default = dbch_##ch; | |
70 | |
26045 | 71 #endif /* MPLAYER_DEBUGTOOLS_H */ |