commit e044f7040554c31a58195fabf1c2740284c02de4
Author: Dieter Verfaillie <dieterv@optionexplicit.be>
Date:   Tue Jun 21 20:18:22 2011 +0200

    Fix gatomic.c compilation on Windows (mingw.org GCC)
    
        -mingw.org's w32api package lacks support for the MemoryBarrier,
         InterlockedAnd, InterlockedOr and InterlockedXor functions so
         we prefer to fall back to GCC's built-in atomic operations.
         To be able to do so, G_ATOMIC_OP_USE_GCC_BUILTINS needs to be
         #defined in glib/glibconfig.h so this patch does so in the
         glib/glibconfig.h.win32.in template.
        -Note that due to mingw.org's GCC weirdness, march and mtune
         need to be specified in CFLAGS
        -This closes Bug 652827

diff --git a/glib/glibconfig.h.win32.in b/glib/glibconfig.h.win32.in
index fbac9d2..5fa5f60 100644
--- a/glib/glibconfig.h.win32.in
+++ b/glib/glibconfig.h.win32.in
@@ -227,6 +227,10 @@ union _GSystemThread
   long   dummy_long;
 };
 
+#ifndef _MSC_VER
+#define G_ATOMIC_OP_USE_GCC_BUILTINS 1
+#endif /* not _MSC_VER */
+
 #define GINT16_TO_LE(val)	((gint16) (val))
 #define GUINT16_TO_LE(val)	((guint16) (val))
 #define GINT16_TO_BE(val)	((gint16) GUINT16_SWAP_LE_BE (val))
