From a31602144ff6fc05ff2a26e3c78d618896dc45e5 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 10 May 2023 12:33:14 +0800 Subject: pangocairo-win32font.c: Work around Cairo API becoming C++ Without adding a small C++ source file in order to include cairo-dwrite.h, where cairo_dwrite_font_face_create_for_dwrite_fontface() now resides and have thus become a C++ API, work around this by adding a wrapper prototype for our own purposes so that we can continue to call that function directly from C. --- pango/pangocairo-win32font.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c index 9d52dbcf..74dfeab1 100644 --- a/pango/pangocairo-win32font.c +++ b/pango/pangocairo-win32font.c @@ -32,6 +32,19 @@ #include +#if defined (HAVE_CAIRO_WIN32_DIRECTWRITE) && \ + ((CAIRO_VERSION_MAJOR > 1) || \ + (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR > 17) || \ + (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR == 17 && CAIRO_VERSION_MICRO > 6)) +/* + * We are using C here, so use a workaround as cairo-dwrite.h from 1.17.8 + * can only be used in C++, which replaces the C-friendly version of + * cairo_dwrite_font_face_create_for_dwrite_fontface() + */ +extern cairo_font_face_t * +cairo_dwrite_font_face_create_for_dwrite_fontface (void *dwrite_font_face); +#endif + #define PANGO_TYPE_CAIRO_WIN32_FONT (pango_cairo_win32_font_get_type ()) #define PANGO_CAIRO_WIN32_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32Font)) #define PANGO_CAIRO_WIN32_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32FontClass)) -- cgit v1.2.1