|
From: <mn...@ke...> - 2011-02-01 20:39:51
|
Module: gst-plugins-bad Branch: master Commit: c32a99559d2826668cb891cc7aff83af587e39b0 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c32a99559d2826668cb891cc7aff83af587e39b0 Author: Mark Nauwelaerts <mar...@co...> Date: Mon Jan 31 17:24:24 2011 +0100 dccp: use socklen_t where appropriate rather than specific type In particular, fixes Cygwin build where socklen_t is defined as int in line with native win32 api definition. --- gst/dccp/gstdccp.c | 6 +----- gst/dccp/gstdccp_common.h | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gst/dccp/gstdccp.c b/gst/dccp/gstdccp.c index 470c217..af652f2 100644 --- a/gst/dccp/gstdccp.c +++ b/gst/dccp/gstdccp.c @@ -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)); diff --git a/gst/dccp/gstdccp_common.h b/gst/dccp/gstdccp_common.h index 9657806..a2c2ca2 100644 --- a/gst/dccp/gstdccp_common.h +++ b/gst/dccp/gstdccp_common.h @@ -32,6 +32,9 @@ # define WINVER 0x0501 # include <winsock2.h> # include <ws2tcpip.h> +#ifndef socklen_t +#define socklen_t int +#endif #endif #include <sys/types.h> #include <unistd.h> |