emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 60fc771: Resurrect SVG support on MS-Windows


From: Eli Zaretskii
Subject: [Emacs-diffs] master 60fc771: Resurrect SVG support on MS-Windows
Date: Thu, 11 Jul 2019 09:29:48 -0400 (EDT)

branch: master
commit 60fc771ac6f090e4e44339cb6d0232a852580ee2
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Resurrect SVG support on MS-Windows
    
    * src/image.c (syms_of_image) <Qgio> [HAVE_NTGUI]: New DEFSYM.
    (init_svg_functions) [LIBRSVG_CHECK_VERSION >= 2.32.0]: Load
    g_file_new_for_path and g_memory_input_stream_new_from_data
    from libgio, not from libglib.  (Bug#35548)
    
    * lisp/term/w32-win.el (dynamic-library-alist): Add the libgio
    DLL.
---
 lisp/term/w32-win.el |  1 +
 src/image.c          | 13 ++++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 044b82e..198182f 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -279,6 +279,7 @@ See the documentation of `create-fontset-from-fontset-spec' 
for the format.")
        '(svg "librsvg-2-2.dll")
        '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
        '(glib "libglib-2.0-0.dll")
+       '(gio "libgio-2.0-0.dll")
        '(gobject "libgobject-2.0-0.dll")
        (if (>= libgnutls-version 30400)
           '(gnutls "libgnutls-30.dll")
diff --git a/src/image.c b/src/image.c
index 3695342..b081d4b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -9336,22 +9336,26 @@ DEF_DLL_FN (void, g_clear_error, (GError **));
 static bool
 init_svg_functions (void)
 {
-  HMODULE library, gdklib = NULL, glib = NULL, gobject = NULL;
+  HMODULE library, gdklib = NULL, glib = NULL, gobject = NULL, giolib = NULL;
 
   if (!(glib = w32_delayed_load (Qglib))
       || !(gobject = w32_delayed_load (Qgobject))
+#  if LIBRSVG_CHECK_VERSION (2, 32, 0)
+      || !(giolib = w32_delayed_load (Qgio))
+#  endif
       || !(gdklib = w32_delayed_load (Qgdk_pixbuf))
       || !(library = w32_delayed_load (Qsvg)))
     {
       if (gdklib)  FreeLibrary (gdklib);
+      if (giolib)  FreeLibrary (giolib);
       if (gobject) FreeLibrary (gobject);
       if (glib)    FreeLibrary (glib);
       return 0;
     }
 
 #if LIBRSVG_CHECK_VERSION (2, 32, 0)
-  LOAD_DLL_FN (glib, g_file_new_for_path);
-  LOAD_DLL_FN (glib, g_memory_input_stream_new_from_data);
+  LOAD_DLL_FN (giolib, g_file_new_for_path);
+  LOAD_DLL_FN (giolib, g_memory_input_stream_new_from_data);
   LOAD_DLL_FN (library, rsvg_handle_new_from_stream_sync);
 #else
   LOAD_DLL_FN (library, rsvg_handle_new);
@@ -10229,6 +10233,9 @@ non-numeric, there is no explicit limit on the size of 
images.  */);
   /* Other libraries used directly by svg code.  */
   DEFSYM (Qgdk_pixbuf, "gdk-pixbuf");
   DEFSYM (Qglib, "glib");
+# if LIBRSVG_CHECK_VERSION (2, 32, 0)
+  DEFSYM (Qgio,  "gio");
+# endif
   DEFSYM (Qgobject, "gobject");
 #endif /* HAVE_NTGUI  */
 #endif /* HAVE_RSVG  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]