libpurple/protocols/oscar/oscar.c

changeset 31117
29f87d7b1bfc
parent 31101
b9f2aeeef7cf
child 31118
8f9ec7016b73
--- 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);

mercurial