From a49c1b5498e8acc34ffaf21bee2169c458c62932 Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Fri, 14 Jun 2013 12:24:47 +0200 Subject: [PATCH] Deprecated gthread functions in newer glib MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since glib 2.32 these are deprecated: • g_thread_init is not required anymore • g_cond_new/g_cond_free → g_cond_init/g_cond_clear --- src/main.c | 2 ++ src/prefs_account.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/main.c b/src/main.c index f51b36f30..451eac97b 100644 --- a/src/main.c +++ b/src/main.c @@ -1039,8 +1039,10 @@ int main(int argc, char *argv[]) if (cmd.exit) return 0; +#if !GLIB_CHECK_VERSION(2,32,0) if (!g_thread_supported()) g_thread_init(NULL); +#endif reset_statistics(); diff --git a/src/prefs_account.c b/src/prefs_account.c index b49ebea0f..32eeeed9f 100644 --- a/src/prefs_account.c +++ b/src/prefs_account.c @@ -3367,7 +3367,11 @@ static gboolean sslcert_get_password(gpointer source, gpointer data) { struct GetPassData pass_data; /* do complicated stuff to be able to call GTK from the mainloop */ +#if !GLIB_CHECK_VERSION(2,32,0) pass_data.cond = g_cond_new(); +#else + g_cond_init(pass_data.cond); +#endif pass_data.mutex = cm_mutex_new(); pass_data.pass = (gchar **)source; @@ -3376,7 +3380,11 @@ static gboolean sslcert_get_password(gpointer source, gpointer data) g_idle_add(do_get_pass, &pass_data); g_cond_wait(pass_data.cond, pass_data.mutex); +#if !GLIB_CHECK_VERSION(2,32,0) g_cond_free(pass_data.cond); +#else + g_cond_clear(pass_data.cond); +#endif g_mutex_unlock(pass_data.mutex); cm_mutex_free(pass_data.mutex); -- 2.25.1