[farsight2/master] Added fix for all inclusions of socket related headers with G_OS_WIN32 usage. Patch from Haakon Sporsheim <haakon.sporsheim at tandberg.com>

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:22:24 PST 2008


---
 .../multicast/fs-multicast-stream-transmitter.c    |   14 ++++++++++----
 transmitters/multicast/fs-multicast-transmitter.c  |   15 +++++++++++----
 transmitters/rawudp/fs-rawudp-component.c          |   14 ++++++++++----
 transmitters/rawudp/fs-rawudp-transmitter.c        |   15 +++++++++++----
 transmitters/rawudp/fs-rawudp-transmitter.h        |    6 +++++-
 5 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/transmitters/multicast/fs-multicast-stream-transmitter.c b/transmitters/multicast/fs-multicast-stream-transmitter.c
index cb6bcd6..df6f701 100644
--- a/transmitters/multicast/fs-multicast-stream-transmitter.c
+++ b/transmitters/multicast/fs-multicast-stream-transmitter.c
@@ -77,14 +77,20 @@
 
 #include <string.h>
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
+#ifdef G_OS_WIN32
+# include <winsock2.h>
+#else /*G_OS_WIN32*/
+# include <netdb.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+#endif /*G_OS_WIN32*/
+
 GST_DEBUG_CATEGORY_EXTERN (fs_multicast_transmitter_debug);
 #define GST_CAT_DEFAULT fs_multicast_transmitter_debug
 
diff --git a/transmitters/multicast/fs-multicast-transmitter.c b/transmitters/multicast/fs-multicast-transmitter.c
index 3e8ad4c..6b6d7b7 100644
--- a/transmitters/multicast/fs-multicast-transmitter.c
+++ b/transmitters/multicast/fs-multicast-transmitter.c
@@ -42,14 +42,21 @@
 
 #include <string.h>
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
+#ifdef G_OS_WIN32
+# include <ws2tcpip.h>
+# define close closesocket
+#else /*G_OS_WIN32*/
+# include <netdb.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+#endif /*G_OS_WIN32*/
+
 GST_DEBUG_CATEGORY (fs_multicast_transmitter_debug);
 #define GST_CAT_DEFAULT fs_multicast_transmitter_debug
 
diff --git a/transmitters/rawudp/fs-rawudp-component.c b/transmitters/rawudp/fs-rawudp-component.c
index 75f6d44..5beef69 100644
--- a/transmitters/rawudp/fs-rawudp-component.c
+++ b/transmitters/rawudp/fs-rawudp-component.c
@@ -38,14 +38,20 @@
 
 #include <string.h>
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
+#ifdef G_OS_WIN32
+# include <winsock2.h>
+#else /*G_OS_WIN32*/
+# include <netdb.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+#endif /*G_OS_WIN32*/
+
 #define GST_CAT_DEFAULT fs_rawudp_transmitter_debug
 
 /* Signals */
diff --git a/transmitters/rawudp/fs-rawudp-transmitter.c b/transmitters/rawudp/fs-rawudp-transmitter.c
index 8c3825b..b640ddd 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-transmitter.c
@@ -42,14 +42,21 @@
 
 #include <string.h>
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
+#ifdef G_OS_WIN32
+# include <winsock2.h>
+# define close closesocket
+#else /*G_OS_WIN32*/
+# include <netdb.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+#endif /*G_OS_WIN32*/
+
 GST_DEBUG_CATEGORY (fs_rawudp_transmitter_debug);
 #define GST_CAT_DEFAULT fs_rawudp_transmitter_debug
 
diff --git a/transmitters/rawudp/fs-rawudp-transmitter.h b/transmitters/rawudp/fs-rawudp-transmitter.h
index 6cb1bab..b4a594f 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.h
+++ b/transmitters/rawudp/fs-rawudp-transmitter.h
@@ -29,7 +29,11 @@
 
 #include <gst/gst.h>
 
-#include <arpa/inet.h>
+#ifdef G_OS_WIN32
+# include <ws2tcpip.h>
+#else /*G_OS_WIN32*/
+# include <arpa/inet.h>
+#endif /*G_OS_WIN32*/
 
 G_BEGIN_DECLS
 
-- 
1.5.6.5




More information about the farsight-commits mailing list