emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master da3897a 3/3: Pacify librsvg 2.45.1 and later


From: Paul Eggert
Subject: [Emacs-diffs] master da3897a 3/3: Pacify librsvg 2.45.1 and later
Date: Fri, 3 May 2019 15:17:38 -0400 (EDT)

branch: master
commit da3897abf1e45741b122b52df37a5cbc68b2ad5d
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.
---
 src/image.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/image.c b/src/image.c
index bf59498..3d724a7 100644
--- a/src/image.c
+++ b/src/image.c
@@ -6735,7 +6735,7 @@ my_error_exit (j_common_ptr cinfo)
 
 
 /* Init source method for JPEG data source manager.  Called by
-   jpeg_read_header() before any data is actually read.  See
+   jpeg_read_header before any data is actually read.  See
    libjpeg.doc from the JPEG lib distribution.  */
 
 static void
@@ -6745,7 +6745,7 @@ our_common_init_source (j_decompress_ptr cinfo)
 
 
 /* Method to terminate data source.  Called by
-   jpeg_finish_decompress() after all data has been processed.  */
+   jpeg_finish_decompress after all data has been processed.  */
 
 static void
 our_common_term_source (j_decompress_ptr cinfo)
@@ -9456,7 +9456,18 @@ svg_load_image (struct frame *f, struct image *img, char 
*contents,
      See rsvg bug 596114 - "image refs are relative to curdir, not .svg file"
      <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */
   if (filename)
-    rsvg_handle_set_base_uri(rsvg_handle, 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);
@@ -9467,6 +9478,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))
     {



reply via email to

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