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.
This commit is contained in:
Mark Nauwelaerts 2011-01-31 17:24:24 +01:00
parent 17c2b30e9b
commit c32a99559d
2 changed files with 4 additions and 5 deletions

View 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));

View file

@ -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>