[pango/pango2: 119/178] pango-font-private.h: Fix builds on Visual Studio+DWrite




commit 011585d37be5ab403372b51133c42957ab71e9ba
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Jun 13 11:51:23 2022 +0800

    pango-font-private.h: Fix builds on Visual Studio+DWrite
    
    The DirectWrite support code sadly needs to be done in C++, meaning that
    more type checking is done by the Visual Studio compiler and one cannot do
    some items in the C99 fashion (i.e. GCCism) as opposed to using plain C.
    
    This fixes the build of pangodwrite-fontmap.cpp for the DWrite support.

 pango/pango-font-private.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/pango/pango-font-private.h b/pango/pango-font-private.h
index 4f498eefc..5644f5911 100644
--- a/pango/pango-font-private.h
+++ b/pango/pango-font-private.h
@@ -79,7 +79,7 @@ static inline void
 pango_font_set_face (PangoFont     *font,
                      PangoFontFace *face)
 {
-  font->face = g_object_ref (face);
+  font->face = (PangoFontFace *) g_object_ref (face);
 }
 
 static inline void
@@ -107,7 +107,8 @@ static inline void
 pango_font_set_ctm (PangoFont         *font,
                     const PangoMatrix *ctm)
 {
-  font->ctm = ctm ? *ctm : (PangoMatrix) PANGO_MATRIX_INIT;
+  const PangoMatrix matrix_init = PANGO_MATRIX_INIT;
+  font->ctm = ctm ? *ctm : matrix_init;
 }
 
 gboolean pango_font_is_hinted         (PangoFont *font);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]