#define DEBUG_LEVEL(WHAT, LEVEL) (_hb_debug ((LEVEL), HB_DEBUG_##WHAT))
#define DEBUG(WHAT) (DEBUG_LEVEL (WHAT, 0))
-template <int max_level> inline bool /* always returns TRUE */
+template <int max_level> inline void
_hb_debug_msg_va (const char *what,
const void *obj,
const char *func,
va_list ap)
{
if (!_hb_debug (level, max_level))
- return TRUE;
+ return;
static const char bars[] = "││││││││││││││││││││││││││││││││││││││││";
vfprintf (stderr, message, ap);
fprintf (stderr, "\n");
-
- return TRUE;
}
-template <> inline bool /* always returns TRUE */
+template <> inline void
_hb_debug_msg_va<0> (const char *what,
const void *obj,
const char *func,
unsigned int level,
int level_dir,
const char *message,
- va_list ap)
-{
- return TRUE;
-}
+ va_list ap) {}
-template <int max_level> inline bool /* always returns TRUE */
+template <int max_level> inline void
_hb_debug_msg (const char *what,
const void *obj,
const char *func,
int level_dir,
const char *message,
...) HB_PRINTF_FUNC(7, 8);
-template <int max_level> inline bool /* always returns TRUE */
+template <int max_level> inline void
_hb_debug_msg (const char *what,
const void *obj,
const char *func,
{
va_list ap;
va_start (ap, message);
-
- bool ret = _hb_debug_msg_va<max_level> (what, obj, func, indented, level, level_dir, message, ap);
-
+ _hb_debug_msg_va<max_level> (what, obj, func, indented, level, level_dir, message, ap);
va_end (ap);
-
- return ret;
}
-template <> inline bool /* always returns TRUE */
+template <> inline void
_hb_debug_msg<0> (const char *what,
const void *obj,
const char *func,
int level_dir,
const char *message,
...) HB_PRINTF_FUNC(7, 8);
-template <> inline bool /* always returns TRUE */
+template <> inline void
_hb_debug_msg<0> (const char *what,
const void *obj,
const char *func,
unsigned int level,
int level_dir,
const char *message,
- ...)
-{
- return TRUE;
-}
+ ...) {}
#define DEBUG_MSG_LEVEL(WHAT, OBJ, LEVEL, LEVEL_DIR, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), NULL, TRUE, (LEVEL), (LEVEL_DIR), __VA_ARGS__)
#define DEBUG_MSG(WHAT, OBJ, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), NULL, FALSE, 0, 0, __VA_ARGS__)