diff -ur glib-2.32.2/glib/gfileutils.c glib-2.32.2.patched/glib/gfileutils.c
--- glib-2.32.2/glib/gfileutils.c	2012-11-05 18:05:06.689000003 +0000
+++ glib-2.32.2.patched/glib/gfileutils.c	2012-11-05 18:13:17.612000003 +0000
@@ -2608,7 +2608,14 @@
   /* This is the backward compatibility system codepage version,
    * thus use normal open().
    */
-  return get_tmp_file (tmpl, (GTmpFileCallback) open,
+  GTmpFileCallback cb;
+#ifdef G_OS_WIN32
+  cb = (GTmpFileCallback) open;
+#else
+  /* on non-win32, g_open is a direct wrapper for open already */
+  cb = (GTmpFileCallback) g_open;
+#endif
+  return get_tmp_file (tmpl, cb,
 		       O_RDWR | O_CREAT | O_EXCL, 0600);
 }
 
diff -ur glib-2.32.2/glib/gstdio.h glib-2.32.2.patched/glib/gstdio.h
--- glib-2.32.2/glib/gstdio.h	2012-11-05 18:05:06.712000003 +0000
+++ glib-2.32.2.patched/glib/gstdio.h	2012-11-05 18:06:59.452000003 +0000
@@ -52,6 +52,11 @@
 
 #endif
 
+int g_open      (const gchar *filename,
+                 int          flags,
+                 int          mode);
+
+
 #if defined(G_OS_UNIX) && !defined(G_STDIO_NO_WRAP_ON_UNIX)
 
 /* Just pass on to the system functions, so there's no potential for data
@@ -62,7 +67,6 @@
 
 #ifndef __GTK_DOC_IGNORE__
 #define g_chmod   chmod
-#define g_open    open
 #define g_creat   creat
 #define g_rename  rename
 #define g_mkdir   mkdir
@@ -101,10 +105,6 @@
 int g_chmod     (const gchar *filename,
 		 int          mode);
 
-int g_open      (const gchar *filename,
-                 int          flags,
-                 int          mode);
-
 int g_creat     (const gchar *filename,
                  int          mode);
 
