[gnome-autoar] Fix MinGW build problem



commit ebfe1f91bf27f950e7dcc41951ac31af1b2555cd
Author: Ting-Wei Lan <lantw44 gmail com>
Date:   Fri Nov 8 18:53:33 2013 +0800

    Fix MinGW build problem

 gnome-autoar/autoar-create.c  |   12 +++++++-----
 gnome-autoar/autoar-extract.c |   18 +++++++++---------
 2 files changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/gnome-autoar/autoar-create.c b/gnome-autoar/autoar-create.c
index 7fd5dd1..26137c4 100644
--- a/gnome-autoar/autoar-create.c
+++ b/gnome-autoar/autoar-create.c
@@ -125,7 +125,7 @@ enum
   PROGRESS,
   CANCELLED,
   COMPLETED,
-  ERROR,
+  AR_ERROR,
   LAST_SIGNAL
 };
 
@@ -610,7 +610,7 @@ libarchive_write_write_cb (struct archive *ar_write,
   if (arcreate->priv->error != NULL)
     return -1;
 
-  g_debug ("libarchive_write_write_cb: %lu", write_size);
+  g_debug ("libarchive_write_write_cb: %" G_GSSIZE_FORMAT, write_size);
   return write_size;
 }
 
@@ -663,7 +663,7 @@ autoar_create_signal_error (AutoarCreate *arcreate)
       autoar_create_signal_cancelled (arcreate);
     } else {
       autoar_common_g_signal_emit (arcreate, arcreate->priv->in_thread,
-                                   autoar_create_signals[ERROR], 0,
+                                   autoar_create_signals[AR_ERROR], 0,
                                    arcreate->priv->error);
     }
   }
@@ -881,7 +881,9 @@ autoar_create_do_add_to_archive (AutoarCreate *arcreate,
       break;
 
     case G_FILE_TYPE_SPECIAL:
-#ifdef HAVE_STAT
+#if (defined HAVE_STAT) && \
+    (defined S_ISBLK) && (defined S_ISSOCK) && \
+    (defined S_ISCHR) && (defined S_ISFIFO)
       {
         struct stat filestat;
         char *local_pathname;
@@ -1190,7 +1192,7 @@ autoar_create_class_init (AutoarCreateClass *klass)
  * GIO, and libarchive, respectively. The #GError is owned by #AutoarCreate
  * and should not be freed.
  **/
-  autoar_create_signals[ERROR] =
+  autoar_create_signals[AR_ERROR] =
     g_signal_new ("error",
                   type,
                   G_SIGNAL_RUN_LAST,
diff --git a/gnome-autoar/autoar-extract.c b/gnome-autoar/autoar-extract.c
index faf8f39..3eaeefd 100644
--- a/gnome-autoar/autoar-extract.c
+++ b/gnome-autoar/autoar-extract.c
@@ -165,7 +165,7 @@ enum
   PROGRESS,
   CANCELLED,
   COMPLETED,
-  ERROR,
+  AR_ERROR,
   LAST_SIGNAL
 };
 
@@ -678,14 +678,14 @@ libarchive_read_read_cb (struct archive *ar_read,
   if (priv->error != NULL)
     return -1;
 
-  g_debug ("libarchive_read_read_cb: %lu", read_size);
+  g_debug ("libarchive_read_read_cb: %" G_GSSIZE_FORMAT, read_size);
   return read_size;
 }
 
-static off_t
+static gint64
 libarchive_read_seek_cb (struct archive *ar_read,
                          void *client_data,
-                         off_t request,
+                         gint64 request,
                          int whence)
 {
   AutoarExtract *arextract;
@@ -729,10 +729,10 @@ libarchive_read_seek_cb (struct archive *ar_read,
   return new_offset;
 }
 
-static off_t
+static gint64
 libarchive_read_skip_cb (struct archive *ar_read,
                          void *client_data,
-                         off_t request)
+                         gint64 request)
 {
   AutoarExtract *arextract;
   AutoarExtractPrivate *priv;
@@ -851,7 +851,7 @@ autoar_extract_signal_error (AutoarExtract *arextract)
       autoar_extract_signal_cancelled (arextract);
     } else {
       autoar_common_g_signal_emit (arextract, arextract->priv->in_thread,
-                                   autoar_extract_signals[ERROR], 0,
+                                   autoar_extract_signals[AR_ERROR], 0,
                                    arextract->priv->error);
     }
   }
@@ -1083,7 +1083,7 @@ autoar_extract_do_write_entry (AutoarExtract *arextract,
         GOutputStream *ostream;
         const void *buffer;
         size_t size, written;
-        off_t offset;
+        gint64 offset;
 
         g_debug ("autoar_extract_do_write_entry: case REG");
         ostream = (GOutputStream*)g_file_replace (dest,
@@ -1458,7 +1458,7 @@ autoar_extract_class_init (AutoarExtractClass *klass)
  * GIO, and libarchive, respectively. The #GError is owned by #AutoarExtract
  * and should not be freed.
  **/
-  autoar_extract_signals[ERROR] =
+  autoar_extract_signals[AR_ERROR] =
     g_signal_new ("error",
                   type,
                   G_SIGNAL_RUN_LAST,


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