2
0
mirror of https://github.com/majn/telegram-purple synced 2025-08-22 01:49:53 +00:00

Support ancient glib

Thanks to @halftux
Closes #501.
This commit is contained in:
Ben Wiederhake 2019-06-09 14:00:11 +02:00
parent 9d2bf54722
commit d1f46ceb67

View File

@ -92,11 +92,20 @@ void tgp_g_queue_free_full (GQueue *queue, GDestroyNotify free_func) {
g_queue_free (queue); g_queue_free (queue);
} }
#if GLIB_CHECK_VERSION(2,28,0)
void tgp_g_list_free_full (GList *list, GDestroyNotify free_func) { void tgp_g_list_free_full (GList *list, GDestroyNotify free_func) {
if (list) { if (list) {
g_list_free_full (list, free_func); g_list_free_full (list, free_func);
} }
} }
#else
void tgp_g_list_free_full (GList *list, GDestroyNotify free_func) {
if (list) {
g_list_foreach (list, (GFunc)free_func, NULL);
g_list_free (list);
}
}
#endif
const char *tgp_mime_to_filetype (const char *mime) { const char *tgp_mime_to_filetype (const char *mime) {
int len = (int) strlen (mime); int len = (int) strlen (mime);