Fix compilation of fdsink and fdsrc with MSVC
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Wed, 17 Feb 2010 00:27:22 +0000 (01:27 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 19 Feb 2010 13:31:54 +0000 (14:31 +0100)
plugins/elements/gstelements.c
plugins/elements/gstfdsink.c
plugins/elements/gstfdsrc.c

index bc5f50b..7835a2b 100644 (file)
@@ -57,6 +57,10 @@ static struct _elements_entry _elements[] = {
   {"fdsrc", GST_RANK_NONE, gst_fd_src_get_type},
   {"fdsink", GST_RANK_NONE, gst_fd_sink_get_type},
 #endif
+#ifdef _MSC_VER
+  {"fdsrc", GST_RANK_NONE, gst_fd_src_get_type},
+  {"fdsink", GST_RANK_NONE, gst_fd_sink_get_type},
+#endif
   {"filesrc", GST_RANK_PRIMARY, gst_file_src_get_type},
   {"identity", GST_RANK_NONE, gst_identity_get_type},
   {"queue", GST_RANK_NONE, gst_queue_get_type},
index f469449..9102185 100644 (file)
 #endif
 
 #include <sys/stat.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
 #include <fcntl.h>
 #include <stdio.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #ifdef _MSC_VER
-#include <io.h>
+#undef stat
+#define stat _stat
+#define fstat _fstat
+#define S_ISREG(m)     (((m)&S_IFREG)==S_IFREG)
 #endif
 #include <errno.h>
 #include <string.h>
index 0683a2c..36abcd7 100644 (file)
 #endif
 
 #include <sys/stat.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
 #include <fcntl.h>
 #include <stdio.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #ifdef _MSC_VER
-#include <io.h>
+#undef stat
+#define stat _stat
+#define fstat _fstat
+#define S_ISREG(m)     (((m)&S_IFREG)==S_IFREG)
 #endif
 #include <stdlib.h>
 #include <errno.h>