... | ... |
@@ -34,7 +34,9 @@ extern "C" { |
34 | 34 |
|
35 | 35 |
#ifdef DEBUG |
36 | 36 |
# include <stdio.h> |
37 |
+# include <stdint.h> |
|
37 | 38 |
|
39 |
+extern uint8_t cli_debug_flag; |
|
38 | 40 |
/* Old GCCs don't have __func__, but __FUNCTION__: |
39 | 41 |
* http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html |
40 | 42 |
*/ |
... | ... |
@@ -46,8 +48,11 @@ extern "C" { |
46 | 46 |
# endif |
47 | 47 |
# endif |
48 | 48 |
/* Adding custom clamav debug code. */ |
49 |
-# define D(x) do { printf("LibClamAV debug: %s:%d (%s)", __FILE__, __LINE__, __func__); \ |
|
50 |
- printf x ; fputc('\n', stdout); fflush(stdout);} while (0); |
|
49 |
+# define D(x) do { if(cli_debug_flag) { \ |
|
50 |
+ printf("LibClamAV debug: %s:%d (%s)", __FILE__, __LINE__, __func__); \ |
|
51 |
+ printf x ; fputc('\n', stdout); fflush(stdout); \ |
|
52 |
+ } \ |
|
53 |
+ } while (0); |
|
51 | 54 |
|
52 | 55 |
#else |
53 | 56 |
# define D(x) |