Glib Atomic Operations



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]