#ifndef HB_DEBUG_HH
#define HB_DEBUG_HH
#include "hb.hh"
#include "hb-atomic.hh"
#include "hb-algs.hh"
#ifndef HB_DEBUG
#define HB_DEBUG …
#endif
struct hb_options_t
{ … };
hb_options_union_t;
static_assert …;
HB_INTERNAL void
_hb_options_init ();
extern HB_INTERNAL hb_atomic_int_t _hb_options;
static inline hb_options_t
hb_options ()
{ … }
static inline bool
_hb_debug (unsigned int level,
unsigned int max_level)
{ … }
#define DEBUG_LEVEL_ENABLED(WHAT, LEVEL) …
#define DEBUG_ENABLED(WHAT) …
static inline void
_hb_print_func (const char *func)
{ … }
template <int max_level> static inline void
_hb_debug_msg_va (const char *what,
const void *obj,
const char *func,
bool indented,
unsigned int level,
int level_dir,
const char *message,
va_list ap) HB_PRINTF_FUNC(7, 0);
template <int max_level> static inline void
_hb_debug_msg_va (const char *what,
const void *obj,
const char *func,
bool indented,
unsigned int level,
int level_dir,
const char *message,
va_list ap)
{ … }
template <> inline void HB_PRINTF_FUNC(7, 0)
_hb_debug_msg_va<0> (const char *what HB_UNUSED,
const void *obj HB_UNUSED,
const char *func HB_UNUSED,
bool indented HB_UNUSED,
unsigned int level HB_UNUSED,
int level_dir HB_UNUSED,
const char *message HB_UNUSED,
va_list ap HB_UNUSED) { … }
template <int max_level> static inline void
_hb_debug_msg (const char *what,
const void *obj,
const char *func,
bool indented,
unsigned int level,
int level_dir,
const char *message,
...) HB_PRINTF_FUNC(7, 8);
template <int max_level> static inline void HB_PRINTF_FUNC(7, 8)
_hb_debug_msg (const char *what,
const void *obj,
const char *func,
bool indented,
unsigned int level,
int level_dir,
const char *message,
...)
{ … }
template <> inline void
_hb_debug_msg<0> (const char *what HB_UNUSED,
const void *obj HB_UNUSED,
const char *func HB_UNUSED,
bool indented HB_UNUSED,
unsigned int level HB_UNUSED,
int level_dir HB_UNUSED,
const char *message HB_UNUSED,
...) HB_PRINTF_FUNC(7, 8);
template <> inline void HB_PRINTF_FUNC(7, 8)
_hb_debug_msg<0> (const char *what HB_UNUSED,
const void *obj HB_UNUSED,
const char *func HB_UNUSED,
bool indented HB_UNUSED,
unsigned int level HB_UNUSED,
int level_dir HB_UNUSED,
const char *message HB_UNUSED,
...) { … }
#define DEBUG_MSG_LEVEL(WHAT, OBJ, LEVEL, LEVEL_DIR, ...) …
#define DEBUG_MSG(WHAT, OBJ, ...) …
#define DEBUG_MSG_FUNC(WHAT, OBJ, ...) …
template <typename T>
struct hb_printer_t { … };
template <>
struct hb_printer_t<bool> { … };
template <>
struct hb_printer_t<hb_empty_t> { … };
template <typename T>
static inline void _hb_warn_no_return (bool returned)
{ … }
template <>
inline void _hb_warn_no_return<hb_empty_t> (bool returned HB_UNUSED) { … }
template <>
inline void _hb_warn_no_return<void> (bool returned HB_UNUSED) { … }
template <int max_level, typename ret_t>
struct hb_auto_trace_t
{ … };
hb_auto_trace_t<0, ret_t>;
template <typename ret_t>
struct hb_no_trace_t { … };
#define return_trace(RET) …
#ifndef HB_DEBUG_ARABIC
#define HB_DEBUG_ARABIC …
#endif
#ifndef HB_DEBUG_BLOB
#define HB_DEBUG_BLOB …
#endif
#ifndef HB_DEBUG_CORETEXT
#define HB_DEBUG_CORETEXT …
#endif
#ifndef HB_DEBUG_DIRECTWRITE
#define HB_DEBUG_DIRECTWRITE …
#endif
#ifndef HB_DEBUG_FT
#define HB_DEBUG_FT …
#endif
#ifndef HB_DEBUG_JUSTIFY
#define HB_DEBUG_JUSTIFY …
#endif
#ifndef HB_DEBUG_OBJECT
#define HB_DEBUG_OBJECT …
#endif
#ifndef HB_DEBUG_SHAPE_PLAN
#define HB_DEBUG_SHAPE_PLAN …
#endif
#ifndef HB_DEBUG_UNISCRIBE
#define HB_DEBUG_UNISCRIBE …
#endif
#ifndef HB_DEBUG_WASM
#define HB_DEBUG_WASM …
#endif
#ifndef HB_DEBUG_APPLY
#define HB_DEBUG_APPLY …
#endif
#if HB_DEBUG_APPLY
#define TRACE_APPLY …
#else
#define TRACE_APPLY(this) …
#endif
#ifndef HB_DEBUG_SANITIZE
#define HB_DEBUG_SANITIZE …
#endif
#if HB_DEBUG_SANITIZE
#define TRACE_SANITIZE …
#else
#define TRACE_SANITIZE(this) …
#endif
#ifndef HB_DEBUG_SERIALIZE
#define HB_DEBUG_SERIALIZE …
#endif
#if HB_DEBUG_SERIALIZE
#define TRACE_SERIALIZE …
#else
#define TRACE_SERIALIZE(this) …
#endif
#ifndef HB_DEBUG_SUBSET
#define HB_DEBUG_SUBSET …
#endif
#if HB_DEBUG_SUBSET
#define TRACE_SUBSET …
#else
#define TRACE_SUBSET(this) …
#endif
#ifndef HB_DEBUG_SUBSET_REPACK
#define HB_DEBUG_SUBSET_REPACK …
#endif
#ifndef HB_DEBUG_PAINT
#define HB_DEBUG_PAINT …
#endif
#if HB_DEBUG_PAINT
#define TRACE_PAINT …
#else
#define TRACE_PAINT(this) …
#endif
#ifndef HB_DEBUG_DISPATCH
#define HB_DEBUG_DISPATCH …
#endif
#if HB_DEBUG_DISPATCH
#define TRACE_DISPATCH …
#else
#define TRACE_DISPATCH(this, format) …
#endif
#ifndef HB_BUFFER_MESSAGE_MORE
#define HB_BUFFER_MESSAGE_MORE …
#endif
#endif