]> granicus.if.org Git - graphviz/commitdiff
janitor - fix warnings from lirsvg api changes
authorJohn Ellson <john.ellson@comcast.net>
Sat, 9 Jan 2016 22:22:09 +0000 (17:22 -0500)
committerJohn Ellson <john.ellson@comcast.net>
Sat, 9 Jan 2016 22:22:09 +0000 (17:22 -0500)
configure.ac
plugin/rsvg/gvloadimage_rsvg.c

index c8f23db52644bbb332bbd6ffb1e0b5575e195740..092c85094fb7caa958253eb07e73495a92590a78 100644 (file)
@@ -2106,6 +2106,7 @@ AC_ARG_WITH(rsvg,
   [AS_HELP_STRING([--with-rsvg=yes],[rsvg library])],
   [], [with_rsvg=yes])
 
+have_svg_2_36="no"
 if test "x$with_rsvg" != "xyes"; then
   use_rsvg="No (disabled)"
 else
@@ -2118,6 +2119,12 @@ else
   ],[
     use_rsvg="No (rsvg library not available)"
   ])
+  PKG_CHECK_MODULES([SVG_2_36], [librsvg-2.0 >= 2.36.0 cairo >= 1.0.0],[
+      have_svg_2_36="yes"
+      AC_DEFINE(HAVE_SVG_2_36, 1, [Have librsvg >= 2.36])
+    ],[
+      have_svg_2_36="no"
+    ])
 fi
 AM_CONDITIONAL(WITH_RSVG, [test "x$use_rsvg" = "xYes"])
 
index 1de7f5ad51516047a6e510bfe1b7cd891c0d2f45..379216a181df79daebe0456dd6efe8c445de1e0b 100644 (file)
@@ -23,7 +23,9 @@
 #ifdef HAVE_PANGOCAIRO
 #ifdef HAVE_RSVG
 #include <librsvg/rsvg.h>
+#ifndef RSVG_CAIRO_H
 #include <librsvg/rsvg-cairo.h>
+#endif
 #include <cairo/cairo-svg.h>
 
 #ifdef WIN32
@@ -73,8 +75,12 @@ static RsvgHandle* gvloadimage_rsvg_load(GVJ_t * job, usershape_t *us)
         switch (us->type) {
             case FT_SVG:
 
+
 #if HAVE_G_TYPE_INIT
+/* g_type_init() was deprecated in glib 2.36.0 */
+#if !GLIB_CHECK_VERSION (2, 36, 0)
                g_type_init();
+#endif
 #else
                rsvg_init();
 #endif
@@ -86,7 +92,9 @@ static RsvgHandle* gvloadimage_rsvg_load(GVJ_t * job, usershape_t *us)
 #if HAVE_G_TYPE_TERM
                        g_type_term();
 #else
+#ifndef HAVE_SVG_2_36
                        rsvg_term();
+#endif
 #endif
                        return NULL;
                } 
@@ -106,7 +114,9 @@ static RsvgHandle* gvloadimage_rsvg_load(GVJ_t * job, usershape_t *us)
 #if HAVE_G_TYPE_TERM
                        g_type_term();
 #else
-                       rsvg_term();
+#ifndef HAVE_SVG_2_36
+                        rsvg_term();
+#endif
 #endif
                        return NULL;
                }
@@ -123,7 +133,9 @@ static RsvgHandle* gvloadimage_rsvg_load(GVJ_t * job, usershape_t *us)
 #if HAVE_G_TYPE_TERM
                        g_type_term();
 #else
-                       rsvg_term();
+#ifndef HAVE_SVG_2_36
+                        rsvg_term();
+#endif
 #endif
                        return NULL;
                }
@@ -139,7 +151,9 @@ static RsvgHandle* gvloadimage_rsvg_load(GVJ_t * job, usershape_t *us)
 #if HAVE_G_TYPE_TERM
                        g_type_term();
 #else
-                       rsvg_term();
+#ifndef HAVE_SVG_2_36
+                        rsvg_term();
+#endif
 #endif
                        return NULL;
                }