Make the protocol.c test program compile on Windows
authorTor Lillqvist <tml@iki.fi>
Tue, 22 Jun 2010 09:41:01 +0000 (12:41 +0300)
committerTor Lillqvist <tml@iki.fi>
Tue, 22 Jun 2010 09:41:01 +0000 (12:41 +0300)
Note that it does not actually work, though. Maybe because
g_io_channel_set_flags() is not implemented for file descriptor based
GIOChannels on Windows.

glib/tests/protocol.c

index 677f385..4d8f63f 100644 (file)
 
 #include <errno.h>  /* errno */
 #include <glib.h>
+#ifndef _WIN32
 #include <unistd.h> /* pipe() */
+#else
+#include <io.h>
+#include <fcntl.h>
+#define pipe(fds) _pipe(fds, 4096, _O_BINARY)
+#endif
 
 static void
 debug (void)