board_effective_handicap(): Take komi into account when no handicap
[pachi/peepo.git] / debug.h
blobab69790e6f69adc335b9b27b0c1ef026ec623c7b
1 #ifndef ZZGO_DEBUG_H
2 #define ZZGO_DEBUG_H
4 #include <stdbool.h>
6 #ifdef DEBUG
7 #define DEBUGL_(l, n) (unlikely((l) > (n)))
8 #define DEBUG_MODE (true)
9 #else
10 #define DEBUGL_(l, n) (false)
11 #define DEBUG_MODE (false)
12 #endif
14 extern int debug_level;
15 extern bool debug_boardprint;
17 #define DEBUGL(n) DEBUGL_(debug_level, n)
19 /* The distributed engine can be _very_ verbose so use DEBUGV
20 * to keep only the first N verbose logs. */
21 #ifndef MAX_VERBOSE_LOGS
22 # define MAX_VERBOSE_LOGS 100000
23 #endif
24 extern long verbose_logs;
25 #define DEBUGV(verbose, n) (DEBUGL(n) && (!(verbose) || ++verbose_logs < MAX_VERBOSE_LOGS))
26 #define DEBUGVV(n) DEBUGV(true, (n))
28 #endif