1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4
* glibcompat.h - GLib version-dependent definitions
6
* Copyright (C) 2012 MATE Desktop Project
8
* Caja is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* Caja is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public
19
* License along with this program; if not, write to the Free
20
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
22
* Authors: Jasmine Hassan <jasmine.aura@gmail.com>
30
#include <glib-object.h>
32
#if !GLIB_CHECK_VERSION (2, 27, 2)
34
g_list_free_full (GList *list, GDestroyNotify free_func)
36
g_list_foreach (list, (GFunc) free_func, NULL);
41
#if !GLIB_CHECK_VERSION(2,28,0)
43
g_clear_object_inline(volatile GObject **object_ptr)
45
gpointer * const ptr = (gpointer)object_ptr;
49
old = g_atomic_pointer_get(ptr);
50
} while G_UNLIKELY(!g_atomic_pointer_compare_and_exchange(ptr, old, NULL));
56
#define g_clear_object(obj) g_clear_object_inline((volatile GObject **)(obj))
59
#endif /* GLIB_COMPAT_H */