[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 7871c3d 4/5: Pacify librsvg 2.45.1 and later
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] emacs-26 7871c3d 4/5: Pacify librsvg 2.45.1 and later |
Date: |
Thu, 30 May 2019 18:29:59 -0400 (EDT) |
branch: emacs-26
commit 7871c3dc9f38a32e1658a3579069a988b0d99623
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Pacify librsvg 2.45.1 and later
* src/image.c (svg_load_image): Pacify librsvg 2.45.1 and later,
and add a FIXME comment about the deprecated librsvg functions.
Backport from master.
---
src/image.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/image.c b/src/image.c
index 50515e1..bda60c0 100644
--- a/src/image.c
+++ b/src/image.c
@@ -9306,6 +9306,17 @@ svg_load_image (struct frame *f, struct image *img, char
*contents,
if (filename)
rsvg_handle_set_base_uri(rsvg_handle, filename);
+ /* Suppress GCC deprecation warnings starting in librsvg 2.45.1 for
+ rsvg_handle_write and rsvg_handle_close. FIXME: Use functions
+ like rsvg_handle_new_from_gfile_sync on newer librsvg versions,
+ and remove this hack. */
+ #if GNUC_PREREQ (4, 6, 0)
+ #pragma GCC diagnostic push
+ #endif
+ #if LIBRSVG_CHECK_VERSION (2, 45, 1) && GNUC_PREREQ (4, 2, 0)
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+
/* Parse the contents argument and fill in the rsvg_handle. */
rsvg_handle_write (rsvg_handle, (unsigned char *) contents, size, &err);
if (err) goto rsvg_error;
@@ -9315,6 +9326,10 @@ svg_load_image (struct frame *f, struct image *img, char
*contents,
rsvg_handle_close (rsvg_handle, &err);
if (err) goto rsvg_error;
+ #if GNUC_PREREQ (4, 6, 0)
+ #pragma GCC diagnostic pop
+ #endif
+
rsvg_handle_get_dimensions (rsvg_handle, &dimension_data);
if (! check_image_size (f, dimension_data.width, dimension_data.height))
{