Fix build for older glib

This commit is contained in:
o9000 2015-12-27 14:29:03 +01:00
parent f8e4cdb56f
commit db44e0824a
3 changed files with 24 additions and 0 deletions

View file

@ -29,6 +29,7 @@
#include "area.h"
#include "server.h"
#include "panel.h"
#include "common.h"
Area *mouse_over_area = NULL;

View file

@ -605,3 +605,18 @@ void get_text_size2(PangoFontDescription *font,
cairo_surface_destroy(cs);
XFreePixmap(server.dsp, pmap);
}
#if !GLIB_CHECK_VERSION (2, 33, 4)
GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data)
{
list = g_list_copy(list);
if (func) {
for (GList *l = list; l; l = l->next) {
l->data = func(l->data, user_data);
}
}
return list;
}
#endif

View file

@ -100,4 +100,12 @@ void clear_pixmap(Pixmap p, int x, int y, int w, int h);
#define free_and_null(p) { free(p); p = NULL; }
#if !GLIB_CHECK_VERSION (2, 33, 4)
GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data);
#endif
#if !GLIB_CHECK_VERSION (2, 38, 0)
#define g_assert_null(expr) g_assert((expr) == NULL)
#endif
#endif