mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
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:
parent
b93b05653e
commit
af13409798
2 changed files with 5 additions and 7 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue