[gsubgpos] Make debug code always available to the compiler

Such that we don't break debug build all the time.
This commit is contained in:
Behdad Esfahbod 2010-04-28 15:15:09 -04:00
parent 41011a6ed7
commit 74e313c016
1 changed files with 26 additions and 26 deletions

View File

@ -32,28 +32,28 @@
#ifndef HB_DEBUG_APPLY #ifndef HB_DEBUG_APPLY
#define HB_DEBUG_APPLY HB_DEBUG #define HB_DEBUG_APPLY HB_DEBUG+0
#endif #endif
#if HB_DEBUG_APPLY static HB_GNUC_UNUSED inline hb_bool_t /* always returns TRUE */
#include <stdio.h> _hb_trace_apply (const char *obj,
#define TRACE_APPLY_ARG_DEF , unsigned int apply_depth HB_GNUC_UNUSED unsigned int apply_depth,
#define TRACE_APPLY_ARG , apply_depth + 1 const char *function)
#define TRACE_APPLY_ARG_INIT , 1 {
#define TRACE_APPLY() \ /* The following check is written in such a skewer way just
HB_STMT_START { \ * to quiet compiler warning. The simple version would have been:
if (apply_depth < HB_DEBUG_APPLY) \ * if (apply_depth < HB_DEBUG_APPLY)
fprintf (stderr, "APPLY(%p) %-*d-> %s\n", \ */
(CharP(this) == CharP(&_NullPool)) ? 0 : this, \ if (HB_DEBUG_APPLY && (int) apply_depth < HB_DEBUG_APPLY)
apply_depth, apply_depth, \ fprintf (stderr, "APPLY(%p) %-*d-> %s\n",
__PRETTY_FUNCTION__); \ (obj == CharP(&_NullPool)) ? 0 : obj,
} HB_STMT_END apply_depth, apply_depth,
#else function);
#define TRACE_APPLY_ARG_DEF return TRUE;
#define TRACE_APPLY_ARG }
#define TRACE_APPLY_ARG_INIT
#define TRACE_APPLY() HB_STMT_START {} HB_STMT_END #define TRACE_APPLY() _hb_trace_apply (CharP(this), apply_depth, __PRETTY_FUNCTION__)
#endif
#define APPLY_ARG_DEF \ #define APPLY_ARG_DEF \
hb_ot_layout_context_t *context, \ hb_ot_layout_context_t *context, \
@ -61,24 +61,24 @@
unsigned int context_length HB_GNUC_UNUSED, \ unsigned int context_length HB_GNUC_UNUSED, \
unsigned int nesting_level_left HB_GNUC_UNUSED, \ unsigned int nesting_level_left HB_GNUC_UNUSED, \
unsigned int lookup_flag HB_GNUC_UNUSED, \ unsigned int lookup_flag HB_GNUC_UNUSED, \
unsigned int property HB_GNUC_UNUSED /* propety of first glyph */ \ unsigned int property HB_GNUC_UNUSED, /* propety of first glyph */ \
TRACE_APPLY_ARG_DEF unsigned int apply_depth HB_GNUC_UNUSED
#define APPLY_ARG \ #define APPLY_ARG \
context, \ context, \
buffer, \ buffer, \
context_length, \ context_length, \
nesting_level_left, \ nesting_level_left, \
lookup_flag, \ lookup_flag, \
property \ property, \
TRACE_APPLY_ARG (HB_DEBUG_APPLY ? apply_depth+1 : 0)
#define APPLY_ARG_INIT \ #define APPLY_ARG_INIT \
context, \ context, \
buffer, \ buffer, \
context_length, \ context_length, \
nesting_level_left, \ nesting_level_left, \
lookup_flag, \ lookup_flag, \
property \ property, \
TRACE_APPLY_ARG_INIT 1
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, const char *data); typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, const char *data);