mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +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;
|
gint ru;
|
||||||
struct sockaddr_in my_addr;
|
struct sockaddr_in my_addr;
|
||||||
guint len;
|
socklen_t len;
|
||||||
int port;
|
int port;
|
||||||
gint ret;
|
gint ret;
|
||||||
GError *error;
|
GError *error;
|
||||||
|
@ -387,13 +387,7 @@ gst_net_time_provider_start (GstNetTimeProvider * self)
|
||||||
goto bind_error;
|
goto bind_error;
|
||||||
|
|
||||||
len = sizeof (my_addr);
|
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);
|
ret = getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr, &len);
|
||||||
#endif
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto getsockname_error;
|
goto getsockname_error;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#ifndef socklen_t
|
||||||
|
#define socklen_t int
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
Loading…
Reference in a new issue