From 7f3b409e85897ff267f1b6a5ce1b5cdafbfe7afe Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 20 Jun 2019 14:24:43 -0700 Subject: [PATCH] Fix build with -O0 message_impl was not defined. That causes trouble if compiler didn't optimize the unreachable call out... --- src/hb-buffer.cc | 1 - src/hb-buffer.hh | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index d1dbd0788..db1978e6d 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -2023,7 +2023,6 @@ hb_buffer_set_message_func (hb_buffer_t *buffer, buffer->message_destroy = nullptr; } } - bool hb_buffer_t::message_impl (hb_font_t *font, const char *fmt, va_list ap) { diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index bc0c7eddc..de0655de3 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -359,6 +359,9 @@ struct hb_buffer_t } bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) { +#ifdef HB_NO_BUFFER_MESSAGE + return true; +#else if (!messaging ()) return true; va_list ap; @@ -366,6 +369,7 @@ struct hb_buffer_t bool ret = message_impl (font, fmt, ap); va_end (ap); return ret; +#endif } HB_INTERNAL bool message_impl (hb_font_t *font, const char *fmt, va_list ap) HB_PRINTF_FUNC(3, 0);