/pidgin/main: 4a1b14508788: Correctly remove deprecated function...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sun Apr 14 15:29:23 EDT 2013


Changeset: 4a1b14508788a750967057bdfbf4bd7c3d654c9f
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-04-14 21:29 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/4a1b14508788

Description:

Correctly remove deprecated functions g_type_init and g_thread_init

diffstat:

 finch/finch.c                     |   6 ++++++
 finch/libgnt/gntmain.c            |   3 +++
 libpurple/core.c                  |   3 +++
 libpurple/glibcompat.h            |  13 -------------
 libpurple/purple-client.c         |   5 ++++-
 libpurple/tests/check_libpurple.c |   3 +++
 libpurple/win32/win32dep.c        |   6 ++++++
 pidgin/gtkmain.c                  |   7 ++++++-
 8 files changed, 31 insertions(+), 15 deletions(-)

diffs (133 lines):

diff --git a/finch/finch.c b/finch/finch.c
--- a/finch/finch.c
+++ b/finch/finch.c
@@ -424,7 +424,13 @@ int main(int argc, char *argv[])
 {
 	signal(SIGPIPE, SIG_IGN);
 
+#if !GLIB_CHECK_VERSION(2, 32, 0)
+	/* GLib threading system is automaticaly initialized since 2.32.
+	 * For earlier versions, it have to be initialized before calling any
+	 * Glib or GTK+ functions.
+	 */
 	g_thread_init(NULL);
+#endif
 
 	g_set_prgname("Finch");
 	g_set_application_name(_("Finch"));
diff --git a/finch/libgnt/gntmain.c b/finch/libgnt/gntmain.c
--- a/finch/libgnt/gntmain.c
+++ b/finch/libgnt/gntmain.c
@@ -508,7 +508,10 @@ void gnt_init()
 	signal(SIGINT, sighandler);
 	signal(SIGPIPE, SIG_IGN);
 
+#if !GLIB_CHECK_VERSION(2, 36, 0)
+	/* GLib type system is automaticaly initialized since 2.36. */
 	g_type_init();
+#endif
 
 	init_wm();
 
diff --git a/libpurple/core.c b/libpurple/core.c
--- a/libpurple/core.c
+++ b/libpurple/core.c
@@ -93,7 +93,10 @@ purple_core_init(const char *ui)
 	wpurple_init();
 #endif
 
+#if !GLIB_CHECK_VERSION(2, 36, 0)
+	/* GLib type system is automaticaly initialized since 2.36. */
 	g_type_init();
+#endif
 
 	_core = core = g_new0(PurpleCore, 1);
 	core->ui = g_strdup(ui);
diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h
--- a/libpurple/glibcompat.h
+++ b/libpurple/glibcompat.h
@@ -25,19 +25,6 @@
  * Also, any public API should not depend on this file.
  */
 
-#if GLIB_CHECK_VERSION(2, 32, 0)
-
-#define g_thread_init(vtable) {}
-
-#if GLIB_CHECK_VERSION(2, 36, 0)
-
-#define g_type_init() {}
-
-#endif /* >= 2.36.0 */
-
-#endif /* >= 2.32.0 */
-
-
 #if !GLIB_CHECK_VERSION(2, 32, 0)
 
 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
diff --git a/libpurple/purple-client.c b/libpurple/purple-client.c
--- a/libpurple/purple-client.c
+++ b/libpurple/purple-client.c
@@ -66,7 +66,10 @@ void purple_init(void)
 {
 	GError *error = NULL;
 
-	g_type_init ();
+#if !GLIB_CHECK_VERSION(2, 36, 0)
+	/* GLib type system is automaticaly initialized since 2.36. */
+	g_type_init();
+#endif
 
 	bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
 	if (!bus)
diff --git a/libpurple/tests/check_libpurple.c b/libpurple/tests/check_libpurple.c
--- a/libpurple/tests/check_libpurple.c
+++ b/libpurple/tests/check_libpurple.c
@@ -33,7 +33,10 @@ static PurpleEventLoopUiOps eventloop_ui
 
 static void
 purple_check_init(void) {
+#if !GLIB_CHECK_VERSION(2, 36, 0)
+	/* GLib type system is automaticaly initialized since 2.36. */
 	g_type_init();
+#endif
 
 	purple_eventloop_set_ui_ops(&eventloop_ui_ops);
 
diff --git a/libpurple/win32/win32dep.c b/libpurple/win32/win32dep.c
--- a/libpurple/win32/win32dep.c
+++ b/libpurple/win32/win32dep.c
@@ -441,8 +441,14 @@ void wpurple_init(void) {
 	WORD wVersionRequested;
 	WSADATA wsaData;
 
+#if !GLIB_CHECK_VERSION(2, 32, 0)
+	/* GLib threading system is automaticaly initialized since 2.32.
+	 * For earlier versions, it have to be initialized before calling any
+	 * Glib or GTK+ functions.
+	 */
 	if (!g_thread_supported())
 		g_thread_init(NULL);
+#endif
 
 	purple_debug_info("wpurple", "wpurple_init start\n");
 	purple_debug_info("wpurple", "libpurple version: " DISPLAY_VERSION "\n");
diff --git a/pidgin/gtkmain.c b/pidgin/gtkmain.c
--- a/pidgin/gtkmain.c
+++ b/pidgin/gtkmain.c
@@ -469,8 +469,13 @@ int main(int argc, char *argv[])
 	debug_enabled = FALSE;
 #endif
 
-	/* Initialize GThread before calling any Glib or GTK+ functions. */
+#if !GLIB_CHECK_VERSION(2, 32, 0)
+	/* GLib threading system is automaticaly initialized since 2.32.
+	 * For earlier versions, it have to be initialized before calling any
+	 * Glib or GTK+ functions.
+	 */
 	g_thread_init(NULL);
+#endif
 
 	g_set_prgname("Pidgin");
 



More information about the Commits mailing list