~ubuntu-branches/ubuntu/wily/caja/wily

« back to all changes in this revision

Viewing changes to src/glibcompat.h

  • Committer: Package Import Robot
  • Author(s): John Paul Adrian Glaubitz, Martin Wimpress, John Paul Adrian Glaubitz
  • Date: 2015-08-10 13:39:55 UTC
  • mfrom: (1.2.1) (9.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20150810133955-b2uyptg7cf8rn8su
Tags: 1.10.3-1
[ Martin Wimpress ]
* New upstream release.
* debian/caja-common.install:
  + Add common files.
* debian/caja.install:
  + Remove common files.
* debian/libcaja-extension-dev.install:
  + Add usr/share/gtk-doc.
* debian/rules:
  + Add --enable-gtk-doc.
  + Remove dfsg suffix.
* debian/watch:
  + Remove dfsg suffix.

[ John Paul Adrian Glaubitz ]
* Fix spelling in debian/control (allows to -> allows one to).
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
 
 
3
 
/*
4
 
 *  glibcompat.h - GLib version-dependent definitions
5
 
 *
6
 
 *  Copyright (C) 2012 MATE Desktop Project
7
 
 *
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.
12
 
 *
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.
17
 
 *
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.
21
 
 *
22
 
 *  Authors: Jasmine Hassan <jasmine.aura@gmail.com>
23
 
 *
24
 
 */
25
 
 
26
 
#ifndef GLIB_COMPAT_H
27
 
#define GLIB_COMPAT_H
28
 
 
29
 
#include <glib.h>
30
 
#include <glib-object.h>
31
 
 
32
 
#if !GLIB_CHECK_VERSION (2, 27, 2)
33
 
static inline void
34
 
g_list_free_full (GList *list, GDestroyNotify free_func)
35
 
{
36
 
    g_list_foreach (list, (GFunc) free_func, NULL);
37
 
    g_list_free (list);
38
 
}
39
 
#endif
40
 
 
41
 
#if !GLIB_CHECK_VERSION(2,28,0)
42
 
static inline void
43
 
g_clear_object_inline(volatile GObject **object_ptr)
44
 
{
45
 
    gpointer * const ptr = (gpointer)object_ptr;
46
 
    gpointer old;
47
 
 
48
 
    do {
49
 
        old = g_atomic_pointer_get(ptr);
50
 
    } while G_UNLIKELY(!g_atomic_pointer_compare_and_exchange(ptr, old, NULL));
51
 
 
52
 
    if (old)
53
 
        g_object_unref(old);
54
 
}
55
 
#undef  g_clear_object
56
 
#define g_clear_object(obj) g_clear_object_inline((volatile GObject **)(obj))
57
 
#endif
58
 
 
59
 
#endif /* GLIB_COMPAT_H */