Commit 56168769 authored by Martin Storsjö's avatar Martin Storsjö

network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows

This avoids warnings.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 9d811fd8
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#define ETIMEDOUT WSAETIMEDOUT #define ETIMEDOUT WSAETIMEDOUT
#define ECONNREFUSED WSAECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED
#define EINPROGRESS WSAEINPROGRESS #define EINPROGRESS WSAEINPROGRESS
#define getsockopt(a, b, c, d, e) getsockopt(a, b, c, (char*) d, e)
#define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*) d, e)
int ff_neterrno(void); int ff_neterrno(void);
#else #else
......
...@@ -252,7 +252,8 @@ const char *ff_gai_strerror(int ecode) ...@@ -252,7 +252,8 @@ const char *ff_gai_strerror(int ecode)
int ff_socket_nonblock(int socket, int enable) int ff_socket_nonblock(int socket, int enable)
{ {
#if HAVE_WINSOCK2_H #if HAVE_WINSOCK2_H
return ioctlsocket(socket, FIONBIO, &enable); u_long param = enable;
return ioctlsocket(socket, FIONBIO, &param);
#else #else
if (enable) if (enable)
return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK); return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment