r23152 - gnucash/branches/2.4 - Don't call g_type_init if GLib is 2.36 or later

John Ralls jralls at code.gnucash.org
Tue Aug 27 14:46:37 EDT 2013


Author: jralls
Date: 2013-08-27 14:46:36 -0400 (Tue, 27 Aug 2013)
New Revision: 23152
Trac: http://svn.gnucash.org/trac/changeset/23152

Modified:
   gnucash/branches/2.4/configure.ac
   gnucash/branches/2.4/src/libqof/qof/qofutil.c
   gnucash/branches/2.4/src/libqof/qof/test/test-qof.c
Log:
Don't call g_type_init if GLib is 2.36 or later

Modified: gnucash/branches/2.4/configure.ac
===================================================================
--- gnucash/branches/2.4/configure.ac	2013-08-26 17:11:40 UTC (rev 23151)
+++ gnucash/branches/2.4/configure.ac	2013-08-27 18:46:36 UTC (rev 23152)
@@ -261,6 +261,14 @@
 else
   AC_MSG_RESULT(no)
 fi
+AC_MSG_CHECKING([for GLib 2.36 or later (glib >=2.36.0)])
+if $PKG_CONFIG "glib-2.0 >= 2.36.0"
+then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE([HAVE_GLIB_2_36], [1], [Configure g_type_init deprecation])
+else
+  AC_MSG_RESULT(no)
+fi
 AM_CONDITIONAL(HAVE_GLIB_TESTING, test "x$_have_glib_testing" = "xyes")
 
 AC_CHECK_HEADERS(dirent.h dlfcn.h dl.h utmp.h locale.h mcheck.h unistd.h wctype.h)
@@ -310,7 +318,7 @@
       PKG_CHECK_MODULES([GTK_MAC], gtk-mac-integration,
                         [_gtk_mac=yes], [_gtk_mac=no])
       if test "x$_gtk_mac" = xyes; then
-        GTK_MAC_LIBS="${GTK_MAC_LIBS} -lobjc"
+        GTK_MAC_LIBS="${GTK_MAC_LIBS} -lobjc -framework Cocoa"
         GTK_MAC_CFLAGS="${GTK_MAC_CFLAGS} -xobjective-c"
       fi
       AC_MSG_RESULT(${_gtk_mac})

Modified: gnucash/branches/2.4/src/libqof/qof/qofutil.c
===================================================================
--- gnucash/branches/2.4/src/libqof/qof/qofutil.c	2013-08-26 17:11:40 UTC (rev 23151)
+++ gnucash/branches/2.4/src/libqof/qof/qofutil.c	2013-08-27 18:46:36 UTC (rev 23152)
@@ -481,7 +481,9 @@
 void
 qof_init (void)
 {
+#ifndef HAVE_GLIB_2_36
     g_type_init();
+#endif
     qof_log_init();
     qof_string_cache_init();
     guid_init ();

Modified: gnucash/branches/2.4/src/libqof/qof/test/test-qof.c
===================================================================
--- gnucash/branches/2.4/src/libqof/qof/test/test-qof.c	2013-08-26 17:11:40 UTC (rev 23151)
+++ gnucash/branches/2.4/src/libqof/qof/test/test-qof.c	2013-08-27 18:46:36 UTC (rev 23152)
@@ -34,7 +34,9 @@
 main (int   argc,
       char *argv[])
 {
+#ifndef HAVE_GLIB_2_36
     g_type_init(); 			/* Initialize the GObject system */
+#endif
     g_test_init ( &argc, &argv, NULL ); 	/* initialize test program */
     qof_log_init_filename_special("stderr"); /* Init the log system */
     g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */



More information about the gnucash-changes mailing list