Ticket #1369 (Update *.hlp files and other docs)
[midnight-commander.git] / src / glibcompat.h
blobc88d6ea8222d37d27639b3ca9ccecc30f9c7f90c
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 /** \file glibcompat.h
19 * \brief Header: old glib compatibility
21 * Following code was copied from glib to GNU Midnight Commander to
22 * provide compatibility with older versions of glib.
25 #ifndef MC_GLIBCOMPAT_H
26 #define MC_GLIBCOMPAT_H
28 #if GLIB_MAJOR_VERSION < 2
30 gsize g_strlcat (gchar *dest, const gchar *src, gsize dest_size);
31 gsize g_strlcpy (gchar *dest, const gchar *src, gsize dest_size);
32 #define g_try_malloc(size) malloc(size)
33 #define g_try_realloc(ptr,size) realloc(ptr,size)
35 static inline GSList *
36 g_slist_delete_link (GSList *list, GSList *link)
38 list = g_slist_remove_link (list, link);
39 g_slist_free_1 (link);
40 return list;
43 #endif /* GLIB_MAJOR_VERSION < 2 */
45 #endif