Improve test coverage for GSubprocess
[platform/upstream/glib.git] / gio / tests / filter-cat.c
index ff7ddd3..d2b9f5c 100644 (file)
 #include <config.h>
 
 #include <stdio.h>
-#include <unistd.h>
 #include <locale.h>
 #include <errno.h>
 
 #include <glib.h>
 #include <gio/gio.h>
 
+#ifdef G_OS_UNIX
+#include <unistd.h>
+#endif
+
+#ifdef G_OS_WIN32
+#ifndef STDOUT_FILENO
+#define STDOUT_FILENO 1
+#endif
+#endif
+
 static gchar **locations = NULL;
 static char *from_charset = NULL;
 static char *to_charset = NULL;
@@ -157,7 +166,7 @@ cat (GFile * file)
        g_input_stream_read (in, buffer, sizeof (buffer) - 1, NULL, &error);
       if (res > 0)
        {
-         ssize_t written;
+         gssize written;
 
          p = buffer;
          while (res > 0)
@@ -215,8 +224,6 @@ main (int argc, char *argv[])
   GFile *file;
   int i;
 
-  g_type_init ();
-
   context =
     g_option_context_new ("LOCATION... - concatenate LOCATIONS "
                          "to standard output.");