--- glib-2.32.2.org/glib/gfileutils.c
+++ glib-2.32.2/glib/gfileutils.c
@@ -1315,7 +1315,7 @@
  * get_tmp_file based on the mkstemp implementation from the GNU C library.
  * Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
  */
-typedef gint (*GTmpFileCallback) (gchar *, gint, gint);
+typedef gint (*GTmpFileCallback) (const gchar *, gint, ...);
 
 static gint
 get_tmp_file (gchar            *tmpl,
@@ -1381,11 +1381,16 @@
 }
 
 static gint
-wrap_mkdir (gchar *tmpl,
-            int    flags G_GNUC_UNUSED,
-            int    mode)
+wrap_mkdir (const gchar *tmpl,
+            int    flags,
+            ...)
 {
   /* tmpl is in UTF-8 on Windows, thus use g_mkdir() */
+  mode_t mode;
+  va_list ap;
+  va_start(ap, flags);
+  mode = va_arg(ap, mode_t);
+  va_end(ap);
   return g_mkdir (tmpl, mode);
 }
 
--- glib-2.32.2.org/glib/gstdio.c
+++ glib-2.32.2/glib/gstdio.c
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <stdarg.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -188,8 +189,13 @@
 int
 g_open (const gchar *filename,
 	int          flags,
-	int          mode)
+	...)
 {
+  mode_t mode;
+  va_list ap;
+  va_start(ap, flags);
+  mode = va_arg(ap, mode_t);
+  va_end(ap);
 #ifdef G_OS_WIN32
   wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
   int retval;
--- glib-2.32.2.org/glib/gstdio.h
+++ glib-2.32.2/glib/gstdio.h
@@ -103,7 +103,7 @@
 
 int g_open      (const gchar *filename,
                  int          flags,
-                 int          mode);
+                 ...);
 
 int g_creat     (const gchar *filename,
                  int          mode);
