dccp: use socklen_t where appropriate rather than specific type
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Mon, 31 Jan 2011 16:24:24 +0000 (17:24 +0100)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 1 Feb 2011 20:36:41 +0000 (21:36 +0100)
In particular, fixes Cygwin build where socklen_t is defined as int
in line with native win32 api definition.

gst/dccp/gstdccp.c
gst/dccp/gstdccp_common.h

index 470c217..af652f2 100644 (file)
@@ -241,18 +241,14 @@ gst_dccp_server_wait_connections (GstElement * element, int server_sock_fd)
   /* new client */
   int client_sock_fd;
   struct sockaddr_in client_address;
-  unsigned int client_address_len;
+  socklen_t client_address_len;
 
   memset (&client_address, 0, sizeof (client_address));
   client_address_len = 0;
 
   if ((client_sock_fd =
           accept (server_sock_fd, (struct sockaddr *) &client_address,
-#ifndef G_OS_WIN32
               &client_address_len)) == -1) {
-#else
-              (int *) &client_address_len)) == -1) {
-#endif
     GST_ELEMENT_ERROR (element, RESOURCE, OPEN_WRITE, (NULL),
         ("Could not accept client on server socket %d: %s (%d)",
             server_sock_fd, g_strerror (errno), errno));
index 9657806..a2c2ca2 100644 (file)
@@ -32,6 +32,9 @@
 #  define WINVER 0x0501\r
 #  include <winsock2.h>\r
 #  include <ws2tcpip.h>\r
+#ifndef socklen_t\r
+#define socklen_t int\r
+#endif\r
 #endif\r
 #include <sys/types.h>\r
 #include <unistd.h>\r