From: Eli Zaretskii Date: Thu, 11 Jul 2019 13:28:41 +0000 (+0300) Subject: Resurrect SVG support on MS-Windows X-Git-Tag: emacs-27.0.90~2009 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=60fc771ac6f090e4e44339cb6d0232a852580ee2;p=emacs.git Resurrect SVG support on MS-Windows * src/image.c (syms_of_image) [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. --- diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 044b82ed1e0..198182fca72 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 3695342232d..b081d4b9123 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 */