talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 78de2d36bee076116e2ce45f55318ddfe81d5d1b
parent 5082e914b7afdc9b211ae0c4cc0347f8a933e0ad
Author: Jonathan Boeing <jonathan@claws-mail.org>
Date:   Mon, 27 Sep 2021 00:22:26 -0700

Set minimum GLib version to 2.36

Diffstat:
Mconfigure.ac | 2+-
Msrc/common/utils.c | 52----------------------------------------------------
Msrc/common/utils.h | 6------
Msrc/main.c | 10----------
Msrc/plugins/notification/notification_plugin.c | 8--------
Msrc/prefs_account.c | 8--------
6 files changed, 1 insertion(+), 85 deletions(-)

diff --git a/configure.ac b/configure.ac @@ -466,7 +466,7 @@ dnl ** common code ** dnl ***************** dnl check for glib -PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.28 gmodule-2.0 >= 2.28 gobject-2.0 >= 2.28 gthread-2.0 >= 2.28]) +PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36 gmodule-2.0 >= 2.36 gobject-2.0 >= 2.36 gthread-2.0 >= 2.36]) GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) diff --git a/src/common/utils.c b/src/common/utils.c @@ -95,17 +95,7 @@ static gboolean debug_mode = FALSE; GSList *slist_copy_deep(GSList *list, GCopyFunc func) { -#if GLIB_CHECK_VERSION(2, 34, 0) return g_slist_copy_deep(list, func, NULL); -#else - GSList *res = g_slist_copy(list); - GSList *walk = res; - while (walk) { - walk->data = func(walk->data, NULL); - walk = walk->next; - } - return res; -#endif } void list_free_strings_full(GList *list) @@ -4457,22 +4447,14 @@ size_t fast_strftime(gchar *buf, gint buflen, const gchar *format, struct tm *lt #endif GMutex *cm_mutex_new(void) { -#if GLIB_CHECK_VERSION(2,32,0) GMutex *m = g_new0(GMutex, 1); g_mutex_init(m); return m; -#else - return g_mutex_new(); -#endif } void cm_mutex_free(GMutex *mutex) { -#if GLIB_CHECK_VERSION(2,32,0) g_mutex_clear(mutex); g_free(mutex); -#else - g_mutex_free(mutex); -#endif } static gchar *canonical_list_to_file(GSList *list) @@ -4664,40 +4646,6 @@ guchar *g_base64_decode_zero(const gchar *text, gsize *out_len) return out; } -#if !GLIB_CHECK_VERSION(2, 30, 0) -/** - * g_utf8_substring: - * @str: a UTF-8 encoded string - * @start_pos: a character offset within @str - * @end_pos: another character offset within @str - * - * Copies a substring out of a UTF-8 encoded string. - * The substring will contain @end_pos - @start_pos - * characters. - * - * Returns: a newly allocated copy of the requested - * substring. Free with g_free() when no longer needed. - * - * Since: GLIB 2.30 - */ -gchar * -g_utf8_substring (const gchar *str, - glong start_pos, - glong end_pos) -{ - gchar *start, *end, *out; - - start = g_utf8_offset_to_pointer (str, start_pos); - end = g_utf8_offset_to_pointer (start, end_pos - start_pos); - - out = g_malloc (end - start + 1); - memcpy (out, start, end - start); - out[end - start] = 0; - - return out; -} -#endif - /* Attempts to read count bytes from a PRNG into memory area starting at buf. * It is up to the caller to make sure there is at least count bytes * available at buf. */ diff --git a/src/common/utils.h b/src/common/utils.h @@ -536,12 +536,6 @@ int cm_canonicalize_filename(const gchar *filename, gchar **canonical_name); guchar *g_base64_decode_zero(const gchar *text, gsize *out_len); -#if !GLIB_CHECK_VERSION(2, 30, 0) -gchar *g_utf8_substring (const gchar *p, - glong start_pos, - glong end_pos) G_GNUC_MALLOC; -#endif - gboolean get_random_bytes(void *buf, size_t count); #ifdef __cplusplus diff --git a/src/main.c b/src/main.c @@ -1140,10 +1140,6 @@ 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(); @@ -1183,12 +1179,6 @@ int main(int argc, char *argv[]) /* Create container for all the menus we will be adding */ MENUITEM_ADDUI("/", "Menus", NULL, GTK_UI_MANAGER_MENUBAR); -#if !GLIB_CHECK_VERSION(2,32,0) - if (!g_thread_supported()) { - g_error("g_thread is not supported by glib"); - } -#endif - #ifdef G_OS_WIN32 CHDIR_EXEC_CODE_RETURN_VAL_IF_FAIL(get_home_dir(), 1, win32_close_log();); #else diff --git a/src/plugins/notification/notification_plugin.c b/src/plugins/notification/notification_plugin.c @@ -220,14 +220,6 @@ gint plugin_init(gchar **error) VERSION_NUMERIC, _("Notification"), error)) return -1; -#if !GLIB_CHECK_VERSION(2,32,0) - /* Check if threading is enabled */ - if(!g_thread_supported()) { - *error = g_strdup(_("The Notification plugin needs threading support.")); - return -1; - } -#endif - hook_f_item = hooks_register_hook(FOLDER_ITEM_UPDATE_HOOKLIST, my_folder_item_update_hook, NULL); if(hook_f_item == 0) { diff --git a/src/prefs_account.c b/src/prefs_account.c @@ -4228,12 +4228,8 @@ 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 pass_data.cond = g_new0(GCond, 1); g_cond_init(pass_data.cond); -#endif pass_data.mutex = cm_mutex_new(); pass_data.pass = (gchar **)source; @@ -4242,12 +4238,8 @@ 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); g_free(pass_data.cond); -#endif g_mutex_unlock(pass_data.mutex); cm_mutex_free(pass_data.mutex);