From: John Ellson Date: Sat, 9 Jan 2016 22:22:09 +0000 (-0500) Subject: janitor - fix warnings from lirsvg api changes X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9cc4171b103b387a53a96b8ed584618c3f56a9b8;p=graphviz janitor - fix warnings from lirsvg api changes --- diff --git a/configure.ac b/configure.ac index c8f23db52..092c85094 100644 --- a/configure.ac +++ b/configure.ac @@ -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"]) diff --git a/plugin/rsvg/gvloadimage_rsvg.c b/plugin/rsvg/gvloadimage_rsvg.c index 1de7f5ad5..379216a18 100644 --- a/plugin/rsvg/gvloadimage_rsvg.c +++ b/plugin/rsvg/gvloadimage_rsvg.c @@ -23,7 +23,9 @@ #ifdef HAVE_PANGOCAIRO #ifdef HAVE_RSVG #include +#ifndef RSVG_CAIRO_H #include +#endif #include #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; }