-/*
- * Trace
- */
-
-
-template <int max_depth>
-struct hb_trace_t {
- explicit hb_trace_t (unsigned int *pdepth, const char *what, const char *function, const void *obj) : pdepth(pdepth) {
- (void) (*pdepth < max_depth &&
- fprintf (stderr, "%s(%p) %-*d-> %s\n", what, obj, *pdepth, *pdepth, function));
- if (max_depth) ++*pdepth;
- }
- ~hb_trace_t (void) { if (max_depth) --*pdepth; }
-
- private:
- unsigned int *pdepth;
-};
-template <> /* Optimize when tracing is disabled */
-struct hb_trace_t<0> {
- explicit hb_trace_t (unsigned int *pdepth HB_UNUSED, const char *what HB_UNUSED, const char *function HB_UNUSED, const void *obj HB_UNUSED) {}
-};
-
-