mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
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:
parent
17c2b30e9b
commit
c32a99559d
2 changed files with 4 additions and 5 deletions
|
@ -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));
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue