Index: third_party/harfbuzz-ng/src/hb-private.hh |
diff --git a/third_party/harfbuzz-ng/src/hb-private.hh b/third_party/harfbuzz-ng/src/hb-private.hh |
index 45b7712ce8fcb9f067ede1028d7a73934da1a525..06b24a80f8d63b2d3073f6fc310157d9892e762d 100644 |
--- a/third_party/harfbuzz-ng/src/hb-private.hh |
+++ b/third_party/harfbuzz-ng/src/hb-private.hh |
@@ -94,16 +94,6 @@ |
# endif |
#endif |
-#ifdef _MSC_VER |
-#undef inline |
-#define inline __inline |
-#endif |
- |
-#ifdef __STRICT_ANSI__ |
-#undef inline |
-#define inline __inline__ |
-#endif |
- |
#if __GNUC__ >= 3 |
#define HB_FUNC __PRETTY_FUNCTION__ |
#elif defined(_MSC_VER) |
@@ -583,6 +573,30 @@ _hb_debug (unsigned int level, |
#define DEBUG_LEVEL_ENABLED(WHAT, LEVEL) (_hb_debug ((LEVEL), HB_DEBUG_##WHAT)) |
#define DEBUG_ENABLED(WHAT) (DEBUG_LEVEL_ENABLED (WHAT, 0)) |
+static inline void |
+_hb_print_func (const char *func) |
+{ |
+ if (func) |
+ { |
+ unsigned int func_len = strlen (func); |
+ /* Skip "static" */ |
+ if (0 == strncmp (func, "static ", 7)) |
+ func += 7; |
+ /* Skip "typename" */ |
+ if (0 == strncmp (func, "typename ", 9)) |
+ func += 9; |
+ /* Skip return type */ |
+ const char *space = strchr (func, ' '); |
+ if (space) |
+ func = space + 1; |
+ /* Skip parameter list */ |
+ const char *paren = strchr (func, '('); |
+ if (paren) |
+ func_len = paren - func; |
+ fprintf (stderr, "%.*s", func_len, func); |
+ } |
+} |
+ |
template <int max_level> static inline void |
_hb_debug_msg_va (const char *what, |
const void *obj, |
@@ -628,27 +642,13 @@ _hb_debug_msg_va (const char *what, |
} else |
fprintf (stderr, " " VRBAR LBAR); |
- if (func) |
- { |
- unsigned int func_len = strlen (func); |
-#ifndef HB_DEBUG_VERBOSE |
- /* Skip "typename" */ |
- if (0 == strncmp (func, "typename ", 9)) |
- func += 9; |
- /* Skip return type */ |
- const char *space = strchr (func, ' '); |
- if (space) |
- func = space + 1; |
- /* Skip parameter list */ |
- const char *paren = strchr (func, '('); |
- if (paren) |
- func_len = paren - func; |
-#endif |
- fprintf (stderr, "%.*s: ", func_len, func); |
- } |
+ _hb_print_func (func); |
if (message) |
+ { |
+ fprintf (stderr, ": "); |
vfprintf (stderr, message, ap); |
+ } |
fprintf (stderr, "\n"); |
} |
@@ -820,7 +820,7 @@ hb_in_range (T u, T lo, T hi) |
/* The sizeof() is here to force template instantiation. |
* I'm sure there are better ways to do this but can't think of |
* one right now. Declaring a variable won't work as HB_UNUSED |
- * is unsable on some platforms and unused types are less likely |
+ * is unusable on some platforms and unused types are less likely |
* to generate a warning than unused variables. */ |
ASSERT_STATIC (sizeof (hb_assert_unsigned_t<T>) >= 0); |