aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-07-11 16:28:41 +0300
committerEli Zaretskii2019-07-11 16:28:41 +0300
commit60fc771ac6f090e4e44339cb6d0232a852580ee2 (patch)
tree32b6153fc57f8b9b85771cb820214e36b6b8b4ce
parent2581513abea46d41ee97ea55b22803e78efc1459 (diff)
downloademacs-60fc771ac6f090e4e44339cb6d0232a852580ee2.tar.gz
emacs-60fc771ac6f090e4e44339cb6d0232a852580ee2.zip
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.
-rw-r--r--lisp/term/w32-win.el1
-rw-r--r--src/image.c13
2 files changed, 11 insertions, 3 deletions
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.")
279 '(svg "librsvg-2-2.dll") 279 '(svg "librsvg-2-2.dll")
280 '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") 280 '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
281 '(glib "libglib-2.0-0.dll") 281 '(glib "libglib-2.0-0.dll")
282 '(gio "libgio-2.0-0.dll")
282 '(gobject "libgobject-2.0-0.dll") 283 '(gobject "libgobject-2.0-0.dll")
283 (if (>= libgnutls-version 30400) 284 (if (>= libgnutls-version 30400)
284 '(gnutls "libgnutls-30.dll") 285 '(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 **));
9336static bool 9336static bool
9337init_svg_functions (void) 9337init_svg_functions (void)
9338{ 9338{
9339 HMODULE library, gdklib = NULL, glib = NULL, gobject = NULL; 9339 HMODULE library, gdklib = NULL, glib = NULL, gobject = NULL, giolib = NULL;
9340 9340
9341 if (!(glib = w32_delayed_load (Qglib)) 9341 if (!(glib = w32_delayed_load (Qglib))
9342 || !(gobject = w32_delayed_load (Qgobject)) 9342 || !(gobject = w32_delayed_load (Qgobject))
9343# if LIBRSVG_CHECK_VERSION (2, 32, 0)
9344 || !(giolib = w32_delayed_load (Qgio))
9345# endif
9343 || !(gdklib = w32_delayed_load (Qgdk_pixbuf)) 9346 || !(gdklib = w32_delayed_load (Qgdk_pixbuf))
9344 || !(library = w32_delayed_load (Qsvg))) 9347 || !(library = w32_delayed_load (Qsvg)))
9345 { 9348 {
9346 if (gdklib) FreeLibrary (gdklib); 9349 if (gdklib) FreeLibrary (gdklib);
9350 if (giolib) FreeLibrary (giolib);
9347 if (gobject) FreeLibrary (gobject); 9351 if (gobject) FreeLibrary (gobject);
9348 if (glib) FreeLibrary (glib); 9352 if (glib) FreeLibrary (glib);
9349 return 0; 9353 return 0;
9350 } 9354 }
9351 9355
9352#if LIBRSVG_CHECK_VERSION (2, 32, 0) 9356#if LIBRSVG_CHECK_VERSION (2, 32, 0)
9353 LOAD_DLL_FN (glib, g_file_new_for_path); 9357 LOAD_DLL_FN (giolib, g_file_new_for_path);
9354 LOAD_DLL_FN (glib, g_memory_input_stream_new_from_data); 9358 LOAD_DLL_FN (giolib, g_memory_input_stream_new_from_data);
9355 LOAD_DLL_FN (library, rsvg_handle_new_from_stream_sync); 9359 LOAD_DLL_FN (library, rsvg_handle_new_from_stream_sync);
9356#else 9360#else
9357 LOAD_DLL_FN (library, rsvg_handle_new); 9361 LOAD_DLL_FN (library, rsvg_handle_new);
@@ -10229,6 +10233,9 @@ non-numeric, there is no explicit limit on the size of images. */);
10229 /* Other libraries used directly by svg code. */ 10233 /* Other libraries used directly by svg code. */
10230 DEFSYM (Qgdk_pixbuf, "gdk-pixbuf"); 10234 DEFSYM (Qgdk_pixbuf, "gdk-pixbuf");
10231 DEFSYM (Qglib, "glib"); 10235 DEFSYM (Qglib, "glib");
10236# if LIBRSVG_CHECK_VERSION (2, 32, 0)
10237 DEFSYM (Qgio, "gio");
10238# endif
10232 DEFSYM (Qgobject, "gobject"); 10239 DEFSYM (Qgobject, "gobject");
10233#endif /* HAVE_NTGUI */ 10240#endif /* HAVE_NTGUI */
10234#endif /* HAVE_RSVG */ 10241#endif /* HAVE_RSVG */