From: Behdad Esfahbod Date: Tue, 18 Jun 2019 20:29:55 +0000 (-0700) Subject: [config] Dont' compile buffer message API if HB_NO_BUFFER_MESSAGE X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb9798ef733da53e69966054b67752cd8937eb7b;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [config] Dont' compile buffer message API if HB_NO_BUFFER_MESSAGE Part of https://github.com/harfbuzz/harfbuzz/issues/1652 --- diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 5dd83fc..d1dbd07 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -1993,6 +1993,7 @@ hb_buffer_diff (hb_buffer_t *buffer, * Debugging. */ +#ifndef HB_NO_BUFFER_MESSAGE /** * hb_buffer_set_message_func: * @buffer: an #hb_buffer_t. @@ -2030,3 +2031,4 @@ hb_buffer_t::message_impl (hb_font_t *font, const char *fmt, va_list ap) vsnprintf (buf, sizeof (buf), fmt, ap); return (bool) this->message_func (this, font, buf, this->message_data); } +#endif diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index 9aae38d..bc0c7ed 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -124,7 +124,9 @@ struct hb_buffer_t unsigned int context_len[2]; /* Debugging API */ +#ifndef HB_NO_BUFFER_MESSAGE hb_buffer_message_func_t message_func; +#endif void *message_data; hb_destroy_func_t message_destroy; @@ -351,8 +353,9 @@ struct hb_buffer_t { #ifdef HB_NO_BUFFER_MESSAGE return false; -#endif +#else return unlikely (message_func); +#endif } bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) {