Merge commit '315633ecce31cd5af92112ab9903f6e7e8ae8df7'
[free-mc.git] / src / glibcompat.h
blobc29c635e93742ffa2110aed54666bdd05f0faca1
1 /* glibcompat.h -- declarations for functions decared in glibcompat.c,
2 i.e. functions present only in recent versions of glib.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 #ifndef MC_GLIBCOMPAT_H
19 #define MC_GLIBCOMPAT_H
21 #if GLIB_MAJOR_VERSION < 2
23 gsize g_strlcat (gchar *dest, const gchar *src, gsize dest_size);
24 gsize g_strlcpy (gchar *dest, const gchar *src, gsize dest_size);
25 #define g_try_malloc(size) malloc(size)
26 #define g_try_realloc(ptr,size) realloc(ptr,size)
28 static inline GSList *
29 g_slist_delete_link (GSList *list, GSList *link)
31 list = g_slist_remove_link (list, link);
32 g_slist_free_1 (link);
33 return list;
36 #endif /* GLIB_MAJOR_VERSION < 2 */
38 #endif