[librsvg2] Fix including rsvg.h always causing a deprecated warning, as this breaks apps compiling with -Werror

Hans de Goede jwrdegoede at fedoraproject.org
Sat Dec 10 09:05:16 UTC 2011


commit 2ba98b25303e626d60c7b7a7a470e5ce2086f757
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Sat Dec 10 10:06:22 2011 +0100

    Fix including rsvg.h always causing a deprecated warning, as this breaks
    apps compiling with -Werror

 librsvg-2.35.0-fix-depcr-warning.patch |   22 ++++++++++++++++++++++
 librsvg2.spec                          |    9 ++++++++-
 2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/librsvg-2.35.0-fix-depcr-warning.patch b/librsvg-2.35.0-fix-depcr-warning.patch
new file mode 100644
index 0000000..d4b2b94
--- /dev/null
+++ b/librsvg-2.35.0-fix-depcr-warning.patch
@@ -0,0 +1,22 @@
+Fix rsvg.h causing an "internal" deprated warning
+
+Before this patch rsvg.h marks the RsvgSizeFunc *type* as deprecated, and
+then uses it to declare other deprecated functions, causing gcc to always
+emit a depecrated warning as soon as rsvg.h is included. This breaks
+compilation of apps which compile with -Werror.
+
+Fix this by not making the RsvgSizeFunc type deprecated, but leaving
+the function prototypes using it as deprecated.
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+--- librsvg-2.35.0/rsvg.h~	2011-11-10 19:22:34.000000000 +0100
++++ librsvg-2.35.0/rsvg.h	2011-12-10 09:11:30.525804670 +0100
+@@ -203,7 +203,7 @@ void rsvg_handle_free (RsvgHandle * hand
+  *
+  * Deprecated: Set up a cairo matrix and use rsvg_handle_render_cairo() instead.
+  */
+-typedef RSVG_DEPRECATED void (*RsvgSizeFunc) (gint * width, gint * height, gpointer user_data);
++typedef void (*RsvgSizeFunc) (gint * width, gint * height, gpointer user_data);
+ 
+ RSVG_DEPRECATED
+ void rsvg_handle_set_size_callback (RsvgHandle * handle,
diff --git a/librsvg2.spec b/librsvg2.spec
index 854b67d..17eb9d5 100644
--- a/librsvg2.spec
+++ b/librsvg2.spec
@@ -1,7 +1,7 @@
 Name:           librsvg2
 Summary:        An SVG library based on cairo
 Version:        2.35.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 
 License:        LGPLv2+
 Group:          System Environment/Libraries
@@ -9,6 +9,8 @@ Group:          System Environment/Libraries
 Source:         http://download.gnome.org/sources/librsvg/2.35/librsvg-%{version}.tar.xz
 
 Patch0:         librsvg2-build-gir.patch
+# filed upstream as: https://bugzilla.gnome.org/show_bug.cgi?id=665905
+Patch1:         librsvg-2.35.0-fix-depcr-warning.patch
 
 
 Requires(post):   gdk-pixbuf2
@@ -53,6 +55,7 @@ files to allow you to develop with librsvg.
 %prep
 %setup -q -n librsvg-%{version}
 %patch0 -p1
+%patch1 -p1
 autoreconf -i -f
 
 %build
@@ -105,6 +108,10 @@ gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache || :
 
 
 %changelog
+* Sat Dec 10 2011 Hans de Goede <hdegoede at redhat.com> - 2.35.0-3
+- Fix including rsvg.h always causing a deprecated warning, as this breaks
+  apps compiling with -Werror
+
 * Fri Nov 25 2011 Daniel Drake <dsd at laptop.org> - 2.35.0-2
 - Build gobject-introspection bindings
 


More information about the scm-commits mailing list