1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

compile with glib1 again

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4320 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Wouter Coekaerts 2006-08-20 13:07:54 +00:00 committed by coekie
parent 8b75299729
commit dee4238e9b
3 changed files with 16 additions and 0 deletions

View File

@ -356,6 +356,14 @@ GSList *nicklist_get_same_unique(SERVER_REC *server, void *id)
return rec.list; return rec.list;
} }
#if GLIB_MAJOR_VERSION < 2
/* glib1 doesn't have g_slist_sort_with_data, so non-standard prefixes won't be sorted correctly */
int nicklist_compare_glib1(NICK_REC *p1, NICK_REC *p2)
{
return nicklist_compare(p1, p2, NULL);
}
#endif
/* nick record comparision for sort functions */ /* nick record comparision for sort functions */
int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix) int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix)
{ {

View File

@ -49,6 +49,9 @@ void nicklist_update_flags_unique(SERVER_REC *server, void *id,
void nicklist_set_own(CHANNEL_REC *channel, NICK_REC *nick); void nicklist_set_own(CHANNEL_REC *channel, NICK_REC *nick);
/* Nick record comparision for sort functions */ /* Nick record comparision for sort functions */
#if GLIB_MAJOR_VERSION < 2
int nicklist_compare_glib1(NICK_REC *p1, NICK_REC *p2);
#endif
int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix); int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix);
/* Check is `msg' is meant for `nick'. */ /* Check is `msg' is meant for `nick'. */

View File

@ -508,7 +508,12 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags)
g_slist_free(nicklist); g_slist_free(nicklist);
/* sort the nicklist */ /* sort the nicklist */
#if GLIB_MAJOR_VERSION < 2
/* glib1 doesn't have g_slist_sort_with_data, so non-standard prefixes won't be sorted correctly */
sorted = g_slist_sort(sorted, (GCompareFunc)nicklist_compare_glib1);
#else
sorted = g_slist_sort_with_data(sorted, (GCompareDataFunc) nicklist_compare, (void *)nick_flags); sorted = g_slist_sort_with_data(sorted, (GCompareDataFunc) nicklist_compare, (void *)nick_flags);
#endif
/* display the nicks */ /* display the nicks */
if ((flags & CHANNEL_NICKLIST_FLAG_COUNT) == 0) { if ((flags & CHANNEL_NICKLIST_FLAG_COUNT) == 0) {