[FFmpeg-cvslog] r9029 - in trunk/libavformat: network.h os_support.c
alex
subversion
Tue May 15 16:58:30 CEST 2007
Author: alex
Date: Tue May 15 16:58:30 2007
New Revision: 9029
Log:
initial mingw networking support
Modified:
trunk/libavformat/network.h
trunk/libavformat/os_support.c
Modified: trunk/libavformat/network.h
==============================================================================
--- trunk/libavformat/network.h (original)
+++ trunk/libavformat/network.h Tue May 15 16:58:30 2007
@@ -21,16 +21,26 @@
#ifndef NETWORK_H
#define NETWORK_H
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
+#define ff_neterrno() WSAGetLastError()
+#define FF_NETERROR(err) WSA##err
+#define WSAEAGAIN WSAEWOULDBLOCK
+#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
#include <netdb.h>
#define ff_neterrno() errno
#define FF_NETERROR(err) err
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
int ff_socket_nonblock(int socket, int enable);
Modified: trunk/libavformat/os_support.c
==============================================================================
--- trunk/libavformat/os_support.c (original)
+++ trunk/libavformat/os_support.c Tue May 15 16:58:30 2007
@@ -117,10 +117,14 @@ int resolve_host(struct in_addr *sin_add
int ff_socket_nonblock(int socket, int enable)
{
+#ifdef __MINGW32__
+ return ioctlsocket(socket, FIONBIO, &enable);
+#else
if (enable)
return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
else
return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK);
+#endif
}
#endif /* CONFIG_NETWORK */
More information about the ffmpeg-cvslog
mailing list