3 #if defined(__GNUC__) && (__GNUC__ >= 3)
4 #define likely(_x) __builtin_expect(!!(_x), 1)
5 #define unlikely(_x) __builtin_expect(!!(_x), 0)
7 #define likely(_x) !!(_x)
8 #define unlikely(_x) !!(_x)
11 #define NHRP_DEBUG_COMMON (1 << 0)
12 #define NHRP_DEBUG_KERNEL (1 << 1)
13 #define NHRP_DEBUG_IF (1 << 2)
14 #define NHRP_DEBUG_ROUTE (1 << 3)
15 #define NHRP_DEBUG_VICI (1 << 4)
16 #define NHRP_DEBUG_EVENT (1 << 5)
17 #define NHRP_DEBUG_ALL (0xFFFF)
19 extern unsigned int debug_flags;
21 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
23 #define debugf(level, ...) \
25 if (unlikely(debug_flags & level)) \
26 zlog_debug(__VA_ARGS__); \
29 #elif defined __GNUC__
31 #define debugf(level, _args...) \
33 if (unlikely(debug_flags & level)) \
39 static inline void debugf(int level, const char *format, ...) { }