win32: Fix build failures of tests
authorBenjamin Otte <otte@redhat.com>
Thu, 11 Mar 2010 19:29:29 +0000 (20:29 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 11 Mar 2010 20:02:45 +0000 (21:02 +0100)
tests/check/elements/fdsrc.c
tests/check/gst/gstpoll.c
tests/check/libs/gstnettimeprovider.c

index 7236356..6c92f6d 100644 (file)
@@ -76,7 +76,11 @@ GST_START_TEST (test_num_buffers)
   gint pipe_fd[2];
   gchar data[4096];
 
+#ifndef G_OS_WIN32
   fail_if (pipe (pipe_fd) < 0);
+#else
+  fail_if (_pipe (pipe_fd, 2048, _O_BINARY) < 0);
+#endif
 
   src = setup_fdsrc ();
   g_object_set (G_OBJECT (src), "num-buffers", 3, NULL);
@@ -113,7 +117,11 @@ GST_START_TEST (test_nonseeking)
   gchar data[4096];
   gboolean seekable;
 
+#ifndef G_OS_WIN32
   fail_if (pipe (pipe_fd) < 0);
+#else
+  fail_if (_pipe (pipe_fd, 2048, _O_BINARY) < 0);
+#endif
 
   src = setup_fdsrc ();
   g_object_set (G_OBJECT (src), "num-buffers", 3, NULL);
index ebfa6d7..612cda1 100644 (file)
@@ -25,6 +25,7 @@
 
 #ifdef G_OS_WIN32
 #include <winsock2.h>
+#include <fcntl.h>
 #define EINPROGRESS WSAEINPROGRESS
 #else
 #include <sys/socket.h>
index 94fd170..1e63270 100644 (file)
@@ -75,7 +75,11 @@ GST_START_TEST (test_functioning)
   memset (&servaddr, 0, sizeof (servaddr));
   servaddr.sin_family = AF_INET;
   servaddr.sin_port = htons (port);
+#ifndef G_OS_WIN32
   inet_aton ("127.0.0.1", &servaddr.sin_addr);
+#else
+  servaddr.sin_addr.s_addr = inet_addr ("127.0.0.1");
+#endif
 
   packet = gst_net_time_packet_new (NULL);
   fail_unless (packet != NULL, "failed to create packet");