OSDN Git Service

network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows
authorMartin Storsjö <martin@martin.st>
Mon, 18 Jun 2012 20:39:30 +0000 (23:39 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 19 Jun 2012 17:22:47 +0000 (20:22 +0300)
This avoids warnings.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/network.h
libavformat/os_support.c

index 72d01d2..1dc9deb 100644 (file)
@@ -35,6 +35,8 @@
 #define ETIMEDOUT       WSAETIMEDOUT
 #define ECONNREFUSED    WSAECONNREFUSED
 #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);
 #else
index 889a005..4181350 100644 (file)
@@ -252,7 +252,8 @@ const char *ff_gai_strerror(int ecode)
 int ff_socket_nonblock(int socket, int enable)
 {
 #if HAVE_WINSOCK2_H
-   return ioctlsocket(socket, FIONBIO, &enable);
+   u_long param = enable;
+   return ioctlsocket(socket, FIONBIO, &param);
 #else
    if (enable)
       return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);