net: 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-29 18:02:11 +01:00
parent b93b05653e
commit af13409798
2 changed files with 5 additions and 7 deletions

View file

@ -352,7 +352,7 @@ gst_net_time_provider_start (GstNetTimeProvider * self)
{
gint ru;
struct sockaddr_in my_addr;
guint len;
socklen_t len;
int port;
gint ret;
GError *error;
@ -387,13 +387,7 @@ gst_net_time_provider_start (GstNetTimeProvider * self)
goto bind_error;
len = sizeof (my_addr);
#ifdef G_OS_WIN32
ret =
getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr,
(gint *) & len);
#else
ret = getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr, &len);
#endif
if (ret < 0)
goto getsockname_error;

View file

@ -35,6 +35,10 @@ G_BEGIN_DECLS
#ifdef G_OS_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#ifndef socklen_t
#define socklen_t int
#endif
#else
#include <netdb.h>
#include <sys/socket.h>