pidgin/android/libpurple

Parents 4efe5c21db45
Children 8b4a41b6fe60
Correctly remove deprecated functions g_type_init and g_thread_init
--- a/finch/finch.c Sun Apr 14 11:37:47 2013 -0700
+++ b/finch/finch.c Sun Apr 14 21:29:14 2013 +0200
@@ -424,7 +424,13 @@
{
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"));
--- a/finch/libgnt/gntmain.c Sun Apr 14 11:37:47 2013 -0700
+++ b/finch/libgnt/gntmain.c Sun Apr 14 21:29:14 2013 +0200
@@ -508,7 +508,10 @@
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();
--- a/libpurple/core.c Sun Apr 14 11:37:47 2013 -0700
+++ b/libpurple/core.c Sun Apr 14 21:29:14 2013 +0200
@@ -93,7 +93,10 @@
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);
--- a/libpurple/glibcompat.h Sun Apr 14 11:37:47 2013 -0700
+++ b/libpurple/glibcompat.h Sun Apr 14 21:29:14 2013 +0200
@@ -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
--- a/libpurple/purple-client.c Sun Apr 14 11:37:47 2013 -0700
+++ b/libpurple/purple-client.c Sun Apr 14 21:29:14 2013 +0200
@@ -66,7 +66,10 @@
{
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)
--- a/libpurple/tests/check_libpurple.c Sun Apr 14 11:37:47 2013 -0700
+++ b/libpurple/tests/check_libpurple.c Sun Apr 14 21:29:14 2013 +0200
@@ -33,7 +33,10 @@
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);
--- a/libpurple/win32/win32dep.c Sun Apr 14 11:37:47 2013 -0700
+++ b/libpurple/win32/win32dep.c Sun Apr 14 21:29:14 2013 +0200
@@ -441,8 +441,14 @@
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");
--- a/pidgin/gtkmain.c Sun Apr 14 11:37:47 2013 -0700
+++ b/pidgin/gtkmain.c Sun Apr 14 21:29:14 2013 +0200
@@ -469,8 +469,13 @@
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");