Glib Atomic Operations
- From: Matthew Bucknall <matthew bucknall googlemail com>
- To: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Glib Atomic Operations
- Date: Fri, 7 Oct 2011 14:13:36 +0100
Hi,
I was looking at the atomic operation macros in gatomic.h. I'm
curious, in the following macro, what is the purpose of '(void) (0 ?
*(atomic) ^ *(atomic) : 0)'?
#define g_atomic_int_get(atomic) \
(G_GNUC_EXTENSION ({
\
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
(void) (0 ? *(atomic) ^ *(atomic) : 0); \
__sync_synchronize (); \
(gint) *(atomic); \
}))
Matt.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]