From 4c0c3f706328c331d072ff37888e346ed6b872d7 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 11 Jun 2013 15:22:02 +0100 Subject: [PATCH] don't call g_type_init() on newer glibs stops a warning message --- configure.ac | 7 +++++++ libvips/iofuncs/init.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6ab4ab85..76fdac52 100644 --- a/configure.ac +++ b/configure.ac @@ -331,6 +331,13 @@ PKG_CHECK_MODULES(THREADS, glib-2.0 >= 2.32,[ ] ) +# after 2.36 the type system inits itself +PKG_CHECK_MODULES(TYPE_INIT, glib-2.0 < 2.36,[ + AC_DEFINE(NEED_TYPE_INIT,1,[define if your glib needs g_type_init().]) + ],[ + ] +) + # check for gtk-doc GTK_DOC_CHECK(1.9) diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 26965dd6..4b74e740 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -192,9 +192,11 @@ vips_init( const char *argv0 ) return( 0 ); started = TRUE; - /* Need gobject etc. +#ifdef NEED_TYPE_INIT + /* Before glib 2.36 you have to call this on startup. */ g_type_init(); +#endif /*NEED_TYPE_INIT*/ /* Older glibs need this. */