1
0
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Added backwards compatible g_list_free_full for glib < 2.28

This commit is contained in:
James Booth 2014-05-21 21:39:31 +01:00
parent e1f4465dc7
commit b3d49f2a3c
5 changed files with 12 additions and 0 deletions

View File

@ -72,6 +72,13 @@ p_slist_free_full(GSList *items, GDestroyNotify free_func)
g_slist_free (items);
}
void
p_list_free_full(GList *items, GDestroyNotify free_func)
{
g_list_foreach (items, (GFunc) free_func, NULL);
g_list_free (items);
}
gboolean
create_dir(char *name)
{

View File

@ -29,6 +29,7 @@
#if !GLIB_CHECK_VERSION(2,28,0)
#define g_slist_free_full(items, free_func) p_slist_free_full(items, free_func)
#define g_list_free_full(items, free_func) p_list_free_full(items, free_func)
#endif
#if !GLIB_CHECK_VERSION(2,30,0)
@ -72,6 +73,7 @@ typedef enum {
gchar* p_utf8_substring(const gchar *str, glong start_pos, glong end_pos);
void p_slist_free_full(GSList *items, GDestroyNotify free_func);
void p_list_free_full(GList *items, GDestroyNotify free_func);
gboolean create_dir(char *name);
gboolean mkdir_recursive(const char *dir);
char * str_replace(const char *string, const char *substr,

View File

@ -27,6 +27,7 @@
#include "jid.h"
#include "config/account.h"
#include "common.h"
ProfAccount*
account_new(const gchar * const name, const gchar * const jid,

View File

@ -26,6 +26,7 @@
#include <glib.h>
#include "contact.h"
#include "common.h"
#include "jid.h"
#include "tools/autocomplete.h"

View File

@ -12,6 +12,7 @@
#include "xmpp/mock_xmpp.h"
#include "muc.h"
#include "common.h"
#include "command/commands.h"