diff network.h @ 2085:8fc44b349f59 libavformat

initial mingw networking support
author alex
date Tue, 15 May 2007 14:58:30 +0000
parents 857fbfeb2fa0
children fb72d949bae3
line wrap: on
line diff
--- a/network.h	Sat May 12 22:17:40 2007 +0000
+++ b/network.h	Tue May 15 14:58:30 2007 +0000
@@ -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);