[dia] [glib-deprecated] g_thread_init and g_type_init
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [glib-deprecated] g_thread_init and g_type_init
- Date: Mon, 9 Jun 2014 08:47:51 +0000 (UTC)
commit 5d863f01f26bdbcabf22c4aee73ae28a3fea57f5
Author: Hans Breuer <hans breuer org>
Date: Sun Jun 8 18:38:20 2014 +0200
[glib-deprecated] g_thread_init and g_type_init
app/app_procs.c | 6 ++++--
tests/test-objects.c | 6 +++++-
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/app/app_procs.c b/app/app_procs.c
index 20f8411..d998160 100644
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -848,17 +848,19 @@ app_init (int argc, char **argv)
/* gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/dia_gnome_icon.png");*/
#else
-# ifdef G_THREADS_ENABLED
+# if defined(G_THREADS_ENABLED) && !GLIB_CHECK_VERSION(2,32,0)
g_thread_init (NULL);
# endif
gtk_init(&argc, &argv);
#endif
}
else {
-#ifdef G_THREADS_ENABLED
+#if defined(G_THREADS_ENABLED) && !GLIB_CHECK_VERSION(2,32,0)
g_thread_init (NULL);
#endif
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
+#endif
/*
* On Windows there is no command line without display so that gtk_init is harmless.
* On X11 we need gtk_init_check() to avoid exit() just because there is no display
diff --git a/tests/test-objects.c b/tests/test-objects.c
index 08e374a..c66bdbe 100644
--- a/tests/test-objects.c
+++ b/tests/test-objects.c
@@ -206,6 +206,7 @@ _test_movement (gconstpointer user_data)
change = o->ops->move (o, &o->position);
if (change) /* usually this is NULL for move */
_object_change_free(change);
+ g_assert (num_connections == o->num_connections);
bbox2 = o->bounding_box;
if ( strcmp (type->name, "Cybernetics - b-sens") == 0
|| strcmp (type->name, "Cybernetics - l-sens") == 0
@@ -234,6 +235,7 @@ _test_movement (gconstpointer user_data)
change = o->ops->move (o, &to);
if (change) /* usually this is NULL for move */
_object_change_free(change);
+ g_assert (num_connections == o->num_connections);
/* does the position reflect the move? */
g_assert ( fabs(fabs(pos.x - o->position.x) - fabs(from.x - to.x)) < EPSILON
&& fabs(fabs(pos.y - o->position.y) - fabs(from.y - to.y)) < EPSILON );
@@ -858,8 +860,10 @@ main (int argc, char** argv)
SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
#endif
- /* not using gtk_test_init() means we can only test non-gtk facilities of objects */
+#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init ();
+#endif
+ /* not using gtk_test_init() means we can only test non-gtk facilities of objects */
g_test_init (&argc, &argv, NULL);
libdia_init (DIA_MESSAGE_STDERR);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]