From: Khaled Hosny Date: Sat, 22 Dec 2018 08:13:06 +0000 (+0200) Subject: Properly fix building with HarfBuzz and without libotf X-Git-Tag: emacs-27.0.90~2671^2~40 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=47ed564056a657eb602559576d59cd66734e7234;p=emacs.git Properly fix building with HarfBuzz and without libotf HarfBuzz support does not depend on libotf, the build breakage when libotf is missing was because code guarded with: #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF was incorrectly changed to: #if defined HAVE_M17N_FLT || defined HAVE_HARFBUZZ this is now properly fixed by making it: #if (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ Other changes in previous commits were reverted. --- diff --git a/src/ftcrfont.c b/src/ftcrfont.c index ae5b0a92eee..95ff89328d6 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -302,7 +302,7 @@ struct font_driver const ftcrfont_driver = #ifdef HAVE_LIBOTF .otf_capability = ftfont_otf_capability, #endif -#if defined HAVE_LIBOTF && (defined HAVE_M17N_FLT || defined HAVE_HARFBUZZ) +#if (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ .shape = ftfont_shape, #endif #ifdef HAVE_OTF_GET_VARIATION_GLYPHS diff --git a/src/ftfont.c b/src/ftfont.c index 8476a74854c..43a3e46e578 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -474,8 +474,9 @@ ftfont_get_otf (struct ftfont_info *ftfont_info) ftfont_info->otf = otf; return otf; } +#endif /* HAVE_LIBOTF */ -# ifdef HAVE_HARFBUZZ +#ifdef HAVE_HARFBUZZ static hb_font_t * ftfont_get_hb_font (struct ftfont_info *ftfont_info) @@ -486,8 +487,7 @@ ftfont_get_hb_font (struct ftfont_info *ftfont_info) return ftfont_info->hb_font; } -# endif /* HAVE_HARFBUZZ */ -#endif /* HAVE_LIBOTF */ +#endif /* HAVE_HARFBUZZ */ Lisp_Object ftfont_get_cache (struct frame *f) @@ -2670,7 +2670,7 @@ ftfont_variation_glyphs (struct font *font, int c, unsigned variations[256]) #endif /* HAVE_LIBOTF */ #ifdef HAVE_HARFBUZZ -#ifdef HAVE_LIBOTF + static hb_unicode_combining_class_t uni_combining (hb_unicode_funcs_t *funcs, hb_codepoint_t ch, void *user_data) { @@ -2929,10 +2929,9 @@ done: return make_fixnum (glyph_len); } -#endif /* HAVE_LIBOTF */ #endif /* HAVE_HARFBUZZ */ -#if defined HAVE_LIBOTF && (defined HAVE_M17N_FLT || defined HAVE_HARFBUZZ) +#if (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ Lisp_Object ftfont_shape (Lisp_Object lgstring) @@ -2957,7 +2956,7 @@ ftfont_shape (Lisp_Object lgstring) } } -#endif /* HAVE_LIBOTF && (HAVE_M17N_FLT || defined HAVE_HARFBUZZ) */ +#endif /* (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ */ static const char *const ftfont_booleans [] = { ":antialias", @@ -3038,7 +3037,7 @@ static struct font_driver const ftfont_driver = #ifdef HAVE_LIBOTF .otf_capability = ftfont_otf_capability, #endif -#if defined HAVE_LIBOTF && (defined HAVE_M17N_FLT || defined HAVE_HARFBUZZ) +#if (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ .shape = ftfont_shape, #endif #ifdef HAVE_OTF_GET_VARIATION_GLYPHS diff --git a/src/ftxfont.c b/src/ftxfont.c index a30b07636e6..66fd9abf530 100644 --- a/src/ftxfont.c +++ b/src/ftxfont.c @@ -359,7 +359,7 @@ struct font_driver const ftxfont_driver = .otf_capability = ftfont_otf_capability, #endif .end_for_frame = ftxfont_end_for_frame, -#if defined HAVE_LIBOTF && (defined HAVE_M17N_FLT || defined HAVE_HARFBUZZ) +#if (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ .shape = ftfont_shape, #endif #ifdef HAVE_OTF_GET_VARIATION_GLYPHS diff --git a/src/xftfont.c b/src/xftfont.c index 5111936f3e7..56d0e30e24c 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -672,7 +672,7 @@ xftfont_draw (struct glyph_string *s, int from, int to, int x, int y, return len; } -#if defined HAVE_LIBOTF && (defined HAVE_M17N_FLT || defined HAVE_HARFBUZZ) +#if (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ static Lisp_Object xftfont_shape (Lisp_Object lgstring) { @@ -784,7 +784,7 @@ struct font_driver const xftfont_driver = .otf_capability = ftfont_otf_capability, #endif .end_for_frame = xftfont_end_for_frame, -#if defined HAVE_LIBOTF && (defined HAVE_M17N_FLT || defined HAVE_HARFBUZZ) +#if (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ .shape = xftfont_shape, #endif #ifdef HAVE_OTF_GET_VARIATION_GLYPHS