# HG changeset patch # User Mark Doliner # Date 1289351842 0 # Node ID e17ac5b9621faab48cc0df45fa516a3913870c31 # Parent 4ba00731d066756fe45cfd651ddd447d373a99bb g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0. So implement a workaround. media.c also uses g_hash_table_get_keys, but I didn't change that one. diff -r 4ba00731d066 -r e17ac5b9621f libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Wed Nov 10 01:00:42 2010 +0000 +++ b/libpurple/protocols/oscar/oscar.c Wed Nov 10 01:17:22 2010 +0000 @@ -637,6 +637,15 @@ return subtype1 - subtype2; } +#if !GLIB_CHECK_VERSION(2,14,0) +static void hash_table_get_list_of_keys(gpointer key, gpointer value, gpointer user_data) +{ + GList **handlers = (GList **)user_data; + + *handlers = g_list_prepend(*handlers, key); +} +#endif /* GLIB < 2.12.0 */ + void oscar_login(PurpleAccount *account) { @@ -706,7 +715,12 @@ oscar_data_addhandler(od, SNAC_FAMILY_USERLOOKUP, 0x0003, purple_parse_searchreply, 0); g_string_append(msg, "Registered handlers: "); +#if GLIB_CHECK_VERSION(2,14,0) handlers = g_hash_table_get_keys(od->handlerlist); +#else + handlers = NULL; + g_hash_table_foreach(od->handlerlist, hash_table_get_list_of_keys, &handlers); +#endif /* GLIB < 2.12.0 */ sorted_handlers = g_list_sort(g_list_copy(handlers), compare_handlers); for (cur = sorted_handlers; cur; cur = cur->next) { guint x = GPOINTER_TO_UINT(cur->data);