From 7def8c9b9860be41ffdfa8436b7442e36be6cea8 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 26 Jan 2011 22:21:31 +0100 Subject: [PATCH] udp: use socklen_t where appropriate rather than custom type In particular, fixes Cygwin build where socklen_t is defined as int in line with native win32 api definition. --- gst/udp/gstmultiudpsink.c | 6 +----- gst/udp/gstudpnetutils.h | 3 +++ gst/udp/gstudpsrc.c | 9 +-------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c index 78e491b..dd93e3f 100644 --- a/gst/udp/gstmultiudpsink.c +++ b/gst/udp/gstmultiudpsink.c @@ -913,11 +913,7 @@ gst_multiudpsink_init_send (GstMultiUDPSink * sink) GList *clients; GstUDPClient *client; int sndsize, ret; -#ifdef G_OS_WIN32 - gint len; -#else - guint len; -#endif + socklen_t len; if (sink->sockfd == -1) { GST_DEBUG_OBJECT (sink, "creating sockets"); diff --git a/gst/udp/gstudpnetutils.h b/gst/udp/gstudpnetutils.h index 6dd8d75..ec863bd 100644 --- a/gst/udp/gstudpnetutils.h +++ b/gst/udp/gstudpnetutils.h @@ -32,6 +32,9 @@ #define WINVER 0x0501 #include #include +#ifndef socklen_t +#define socklen_t int +#endif /* Needed for GstObject and GST_WARNING_OBJECT */ #include diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index b76385b..f00c74b 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -117,9 +117,6 @@ #endif #include -#ifdef G_OS_WIN32 -typedef int socklen_t; -#endif #ifdef HAVE_FIONREAD_IN_SYS_FILIO #include @@ -778,11 +775,7 @@ gst_udpsrc_start (GstBaseSrc * bsrc) gint ret; int rcvsize; struct sockaddr_storage bind_address; -#ifdef G_OS_WIN32 - gint len; -#else - guint len; -#endif + socklen_t len; src = GST_UDPSRC (bsrc); if (src->sockfd == -1) { -- 2.7.4