21#ifndef __GREFCOUNT_H__
22#define __GREFCOUNT_H__
24#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
25#error "Only <glib.h> can be included directly."
77#define G_REF_COUNT_INIT -1 \
78 GLIB_AVAILABLE_MACRO_IN_2_78
104#define G_ATOMIC_REF_COUNT_INIT 1 \
105 GLIB_AVAILABLE_MACRO_IN_2_78
111#if defined(__GNUC__) && defined(G_DISABLE_CHECKS)
113# define g_ref_count_init(rc) \
114 (G_GNUC_EXTENSION ({ \
115 G_STATIC_ASSERT (sizeof *(rc) == sizeof (grefcount)); \
116 (void) (0 ? *(rc) ^ *(rc) : 1); \
120# define g_ref_count_inc(rc) \
121 (G_GNUC_EXTENSION ({ \
122 G_STATIC_ASSERT (sizeof *(rc) == sizeof (grefcount)); \
123 (void) (0 ? *(rc) ^ *(rc) : 1); \
124 if (*(rc) == G_MININT) ; else { \
129# define g_ref_count_dec(rc) \
130 (G_GNUC_EXTENSION ({ \
131 G_STATIC_ASSERT (sizeof *(rc) == sizeof (grefcount)); \
132 grefcount __rc = *(rc); \
134 if (__rc == 0) ; else { \
137 (gboolean) (__rc == 0); \
140# define g_ref_count_compare(rc,val) \
141 (G_GNUC_EXTENSION ({ \
142 G_STATIC_ASSERT (sizeof *(rc) == sizeof (grefcount)); \
143 (void) (0 ? *(rc) ^ (val) : 1); \
144 (gboolean) (*(rc) == -(val)); \
147# define g_atomic_ref_count_init(rc) \
148 (G_GNUC_EXTENSION ({ \
149 G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
150 (void) (0 ? *(rc) ^ *(rc) : 1); \
154# define g_atomic_ref_count_inc(rc) \
155 (G_GNUC_EXTENSION ({ \
156 G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
157 (void) (0 ? *(rc) ^ *(rc) : 1); \
158 (void) (g_atomic_int_get (rc) == G_MAXINT ? 0 : g_atomic_int_inc ((rc))); \
161# define g_atomic_ref_count_dec(rc) \
162 (G_GNUC_EXTENSION ({ \
163 G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
164 (void) (0 ? *(rc) ^ *(rc) : 1); \
165 g_atomic_int_dec_and_test ((rc)); \
168# define g_atomic_ref_count_compare(rc,val) \
169 (G_GNUC_EXTENSION ({ \
170 G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
171 (void) (0 ? *(rc) ^ (val) : 1); \
172 (gboolean) (g_atomic_int_get (rc) == (val)); \
#define GLIB_AVAILABLE_IN_2_58
GLIB_AVAILABLE_IN_2_58 gboolean g_atomic_ref_count_dec(gatomicrefcount *arc)
GLIB_AVAILABLE_IN_2_58 gboolean g_ref_count_compare(grefcount *rc, gint val)
GLIB_AVAILABLE_IN_2_58 void g_ref_count_inc(grefcount *rc)
GLIB_AVAILABLE_IN_2_58 void g_atomic_ref_count_init(gatomicrefcount *arc)
GLIB_AVAILABLE_IN_2_58 gboolean g_ref_count_dec(grefcount *rc)
G_BEGIN_DECLS GLIB_AVAILABLE_IN_2_58 void g_ref_count_init(grefcount *rc)
GLIB_AVAILABLE_IN_2_58 gboolean g_atomic_ref_count_compare(gatomicrefcount *arc, gint val)
GLIB_AVAILABLE_IN_2_58 void g_atomic_ref_count_inc(gatomicrefcount *arc)