~ubuntu-branches/ubuntu/vivid/gnome-desktop3/vivid-proposed

« back to all changes in this revision

Viewing changes to libgnome-desktop/libgsystem/gsystem-glib-compat.h

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-09-12 07:22:38 UTC
  • mfrom: (1.6.4) (31.1.1 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20140912072238-fv5g0rpwuk5yynip
Tags: 3.12.2-2ubuntu1
* New upstream release (LP: #1372346)
* Merge with Debian, Remaining changes:
  - debian/patches:
    + 04_compute_average_color.patch: Compute the avergage color in
      gnome-desktop itself, not in unity to fix some races (LP #963140)
    + tweak_color_computation.patch, Patch from Gord, no patch header,
      no bug link.
    + git_revert_draw_background.patch
    + ubuntu_language.patch, Ported relevant bits from g-c-c 
      52_region_language.patch, as required for gnome 3.8 region panel
    + ubuntu_language_list_from_SUPPORTED.patch,
      adds api to get list of available languages from SUPPORTED file.
      To be used by gnome 3.8 region panel language installation.
  - debian/rules:
    + drop obsolete --disable-scrollkeeper configure flag
  - debian/libgnome-desktop-3-10.symbols:
    + Add symbols included in Ubuntu patches
  - debian/control.in:
    + Mark gnome-desktop3-data Multi-Arch: foreign
* Dropped changes:
  - 02_refuse_to_break_GL_compositors.patch:
    + xrandr code has moved into libunity-settings-daemon now

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
 
2
 *
 
3
 * Copyright (C) 2012,2013 Colin Walters <walters@verbum.org>.
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2 of the License, or (at your option) any later version.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public
 
16
 * License along with this library; if not, write to the
 
17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
 * Boston, MA 02111-1307, USA.
 
19
 */
 
20
 
 
21
#ifndef __LIBGSYSTEM_GLIB_COMPAT__
 
22
#define __LIBGSYSTEM_GLIB_COMPAT__
 
23
 
 
24
#include <gio/gio.h>
 
25
 
 
26
#if !GLIB_CHECK_VERSION(2,34,0)
 
27
static inline void
 
28
g_type_ensure (GType type)
 
29
{
 
30
  if (G_UNLIKELY (type == (GType)-1))
 
31
    g_error ("can't happen");
 
32
}
 
33
 
 
34
#define g_clear_pointer(pp, destroy)      \
 
35
        G_STMT_START { \
 
36
                G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
 
37
                /* Only one access, please */ \
 
38
                gpointer *_pp = (gpointer *) (pp); \
 
39
                gpointer _p; \
 
40
                /* This assignment is needed to avoid a gcc warning */ \
 
41
                GDestroyNotify _destroy = (GDestroyNotify) (destroy); \
 
42
          \
 
43
                (void) (0 ? (gpointer) *(pp) : 0); \
 
44
                do \
 
45
                        _p = g_atomic_pointer_get (_pp); \
 
46
                while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_pp, _p, NULL)); \
 
47
          \
 
48
                if (_p) \
 
49
                        _destroy (_p); \
 
50
        } G_STMT_END
 
51
 
 
52
#endif
 
53
 
 
54
#endif