xref: /haiku/src/add-ons/kernel/drivers/audio/ice1712/debug.h (revision 1b8f7f13a3dc70e0e903cb94248220b40b732204)
1 /*
2  * ice1712 BeOS/Haiku Driver for VIA - VT1712 Multi Channel Audio Controller
3  *
4  * Copyright (c) 2002, Jerome Duval		(jerome.duval@free.fr)
5  * Copyright (c) 2003, Marcus Overhagen	(marcus@overhagen.de)
6  * Copyright (c) 2007, Jerome Leveque	(leveque.jerome@neuf.fr)
7  *
8  * All rights reserved
9  * Distributed under the terms of the MIT license.
10  */
11 
12 #ifndef _DEBUG_H_
13 #define _DEBUG_H_
14 
15 /*
16  * PRINT() executes dprintf if DEBUG = 0 (disabled), or expands to LOG() when DEBUG > 0
17  * TRACE() executes dprintf if DEBUG > 0
18  * LOG()   executes dprintf and writes to the logfile if DEBUG > 0
19  */
20 
21 /* DEBUG == 0, no debugging, PRINT writes to syslog
22  * DEBUG == 1, TRACE & LOG, PRINT
23  * DEBUG == 2, TRACE & LOG, PRINT with snooze()
24  */
25 #undef DEBUG
26 
27 #ifndef DEBUG
28 //	#define DEBUG 1
29 #endif
30 
31 #undef PRINT_ICE
32 #undef TRACE_ICE
33 #undef ASSERT_ICE
34 
35 #if DEBUG > 0
36 	#define PRINT_ICE(a)		log_printf a
37 //	#define TRACE_ICE(a) 		debug_printf a
38 	#define TRACE_ICE(a) 		log_printf a
39 	#define LOG_ICE(a)			log_printf a
40 	#define LOG_CREATE_ICE()	log_create()
41 	#define ASSERT_ICE(a)		if (a) {} else LOG_ICE(("ASSERT failed! file = %s, line = %d\n",__FILE__,__LINE__))
42 	void log_create();
43 	void log_printf(const char *text,...);
44 	void debug_printf(const char *text,...);
45 #else
46 	void debug_printf(const char *text,...);
47 	#define PRINT_ICE(a)	debug_printf a
48 	#define TRACE_ICE(a)	((void)(0))
49 	#define ASSERT_ICE(a)	((void)(0))
50 	#define LOG_ICE(a)		((void)(0))
51 	#define LOG_CREATE_ICE()
52 #endif
53 
54 #endif
55