Subject: bug#74606: 31.0.50; Another rsvg API change

From: Manuel Giraud <[email-masked]>
Date: Mon, 02 Dec 2024 17:03:34 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Manuel Giraud <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Mon, 02 Dec 2024 16:02:40 +0100
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> >> From: Manuel Giraud <[email-masked]>
>> >> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
>> >> Date: Mon, 02 Dec 2024 15:14:54 +0100
>> >> 
>> >> > On this page, when you unfold the link "Tags containing commit", you can
>> >> > see that 2.58.90 is the first one.  So maybe, I should use this version
>> >> > instead.  WDYT?
>> >> >
>> >> > The "Deprecated: 2.58" from the header looks like a copy/paste
>> >> > mistake.
>> >> 
>> >> Here is a patch to be applied on emacs-30.
>> >
>> > Thanks, but did you verify that 2.58.90 actually has this function?
>> > Is the tarball of that version's sources available somewhere we could
>> > check?
>> 
>> No I didn't.  I've only used the commit log.
>> 
>> > Alternatively, we could use 2.59, since 2.58.90 is a pretest, so I see
>> > no catastrophe if someone sees warnings while using it.
>> 
>> I agree: no catastrophe and low probability too.  Do you want me to
>> modify the patch to check for 2.59?
>
> Yes, please.

Here it is.
>From 5f9f676dce22afbc477b555b610dd0adeefa37f2 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <[email-masked]>
Date: Mon, 2 Dec 2024 15:11:52 +0100
Subject: [PATCH] Fix the version of librsvg API change

* src/image.c (init_svg_functions, svg_load_image): The first
official version that introduces
'rsvg_handle_get_pixbuf_and_error' is 2.59.0 not 2.58.0.
---
 src/image.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/image.c b/src/image.c
index 43220758324..0012abcb451 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11688,7 +11688,7 @@ DEF_DLL_FN (void, rsvg_handle_get_dimensions,
 DEF_DLL_FN (gboolean, rsvg_handle_set_stylesheet,
 	    (RsvgHandle *, const guint8 *, gsize, GError **));
 #  endif
-#  if LIBRSVG_CHECK_VERSION (2, 58, 0)
+#  if LIBRSVG_CHECK_VERSION (2, 59, 0)
 DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf_and_error, (RsvgHandle *, GError **));
 #  else
 DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *));
@@ -11751,7 +11751,7 @@ init_svg_functions (void)
 #if LIBRSVG_CHECK_VERSION (2, 48, 0)
   LOAD_DLL_FN (library, rsvg_handle_set_stylesheet);
 #endif
-#if LIBRSVG_CHECK_VERSION (2, 58, 0)
+#if LIBRSVG_CHECK_VERSION (2, 59, 0)
   LOAD_DLL_FN (library, rsvg_handle_get_pixbuf_and_error);
 #else
   LOAD_DLL_FN (library, rsvg_handle_get_pixbuf);
@@ -11800,7 +11800,7 @@ init_svg_functions (void)
 #  if LIBRSVG_CHECK_VERSION (2, 48, 0)
 #   undef rsvg_handle_set_stylesheet
 #  endif
-#  if LIBRSVG_CHECK_VERSION (2, 58, 0)
+#  if LIBRSVG_CHECK_VERSION (2, 59, 0)
 #   undef rsvg_handle_get_pixbuf_and_error
 #  else
 #   undef rsvg_handle_get_pixbuf
@@ -11845,7 +11845,7 @@ init_svg_functions (void)
 #  if LIBRSVG_CHECK_VERSION (2, 48, 0)
 #   define rsvg_handle_set_stylesheet fn_rsvg_handle_set_stylesheet
 #  endif
-#  if LIBRSVG_CHECK_VERSION (2, 58, 0)
+#  if LIBRSVG_CHECK_VERSION (2, 59, 0)
 #   define rsvg_handle_get_pixbuf_and_error fn_rsvg_handle_get_pixbuf_and_error
 #  else
 #   define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf
@@ -12354,7 +12354,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 
   /* We can now get a valid pixel buffer from the svg file, if all
      went ok.  */
-#if LIBRSVG_CHECK_VERSION (2, 58, 0)
+#if LIBRSVG_CHECK_VERSION (2, 59, 0)
   pixbuf = rsvg_handle_get_pixbuf_and_error (rsvg_handle, &err);
   if (err) goto rsvg_error;
 #else
-- 
2.47.0

-- 
Manuel Giraud