Small glib 2.28 patch for Win32



$TITLE says it all

Kean
--- gio/glib-compile-schemas.c.orig.jUX	2011-03-14 00:52:40 +0200
+++ gio/glib-compile-schemas.c	2011-03-29 15:00:33 +0200
@@ -26,7 +26,9 @@
 #include <gstdio.h>
 #include <locale.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <stdio.h>
 
 #include <gi18n.h>
--- gio/glocalfile.c.orig.jUX	2011-03-22 12:08:34 +0200
+++ gio/glocalfile.c	2011-03-22 12:09:46 +0200
@@ -1297,8 +1297,8 @@
 		   GError       **error)
 {
   GLocalFile *local = G_LOCAL_FILE (file);
-  int fd;
-  struct stat buf;
+  int fd, ret;
+  GLocalFileStat buf;
   
   fd = g_open (local->filename, O_RDONLY|O_BINARY, 0);
   if (fd == -1)
@@ -1312,7 +1312,13 @@
       return NULL;
     }
 
-  if (fstat(fd, &buf) == 0 && S_ISDIR (buf.st_mode))
+#ifdef G_OS_WIN32
+  ret = _fstati64 (fd, &buf);
+#else
+  ret = fstat (fd, &buf);
+#endif
+
+  if (ret == 0 && S_ISDIR (buf.st_mode))
     {
       close (fd);
       g_set_error_literal (error, G_IO_ERROR,
--- gio/glocalfileoutputstream.c.orig.jUX	2011-03-22 12:03:43 +0200
+++ gio/glocalfileoutputstream.c	2011-03-22 12:05:58 +0200
@@ -909,10 +909,16 @@
 	    )
 	  )
 	{
-	  struct stat tmp_statbuf;
-	  
+          GLocalFileStat tmp_statbuf;
+          int tres;
+
+#ifdef G_OS_WIN32
+          tres = _fstati64 (tmpfd, &tmp_statbuf);
+#else
+          tres = fstat (tmpfd, &tmp_statbuf);
+#endif
 	  /* Check that we really needed to change something */
-	  if (fstat (tmpfd, &tmp_statbuf) != 0 ||
+	  if (tres != 0 ||
 	      original_stat.st_uid != tmp_statbuf.st_uid ||
 	      original_stat.st_gid != tmp_statbuf.st_gid ||
 	      original_stat.st_mode != tmp_statbuf.st_mode)
--- gio/gvdb/gvdb-builder.c.orig.jUX	2011-01-28 02:48:02 +0200
+++ gio/gvdb/gvdb-builder.c	2011-03-29 14:58:19 +0200
@@ -24,7 +24,9 @@
 
 #include <glib.h>
 #include <fcntl.h>
+#if !defined(G_OS_WIN32) || !defined(_MSC_VER)
 #include <unistd.h>
+#endif
 #include <string.h>
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]