]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSCore/mDNSDebug.h
mDNSResponder-26.2.tar.gz
[apple/mdnsresponder.git] / mDNSCore / mDNSDebug.h
1 // Set DEBUGBREAKS to 0 to optimize debugf() calls out of the compiled code
2 // Set DEBUGBREAKS to 1 to generate normal debugging messages
3 // Set DEBUGBREAKS to 2 to generate verbose debugging messages
4 // DEBUGBREAKS is normally set in the project options (or makefile) but can also be set here if desired
5
6 //#define DEBUGBREAKS 2
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 #if DEBUGBREAKS
13 #define debugf debugf_
14 extern void debugf_(const char *format, ...);
15 #else // If debug breaks are off, use a preprocessor trick to optimize those calls out of the code
16 #if( defined( __GNUC__ ) )
17 #define debugf( ARGS... )
18 #elif( defined( __MWERKS__ ) )
19 #define debugf( ... )
20 #else
21 #define debugf 1 ? ((void) 0) : (void)
22 #endif
23 #endif
24
25 #if DEBUGBREAKS > 1
26 #define verbosedebugf debugf_
27 #else
28 #if( defined( __GNUC__ ) )
29 #define verbosedebugf( ARGS... )
30 #elif( defined( __MWERKS__ ) )
31 #define verbosedebugf( ... )
32 #else
33 #define verbosedebugf 1 ? ((void) 0) : (void)
34 #endif
35 #endif
36
37 #ifdef __cplusplus
38 }
39 #endif