aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/network.h
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2007-05-15 14:58:30 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2007-05-15 14:58:30 +0000
commit5676d140a9e93aeead7b17f01d42fb8987b1dd60 (patch)
tree46929e739b9164ebd43074e38f4035a8da12489d /libavformat/network.h
parent124bed6fb2dfb937ea7b76121d5f8eba47d15d68 (diff)
downloadffmpeg-5676d140a9e93aeead7b17f01d42fb8987b1dd60.tar.gz
initial mingw networking support
Originally committed as revision 9029 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/network.h')
-rw-r--r--libavformat/network.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/libavformat/network.h b/libavformat/network.h
index 6ceba41902..723b4f9536 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -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);