Win32 build fix.
[qemu] / slirp / slirp.h
index b52044a..1ff68cb 100644 (file)
@@ -20,6 +20,7 @@ typedef uint32_t u_int32_t;
 typedef uint64_t u_int64_t;
 typedef char *caddr_t;
 
+# include <windows.h>
 # include <winsock2.h>
 # include <sys/timeb.h>
 # include <iphlpapi.h>
@@ -33,6 +34,7 @@ typedef char *caddr_t;
 #else
 # define ioctlsocket ioctl
 # define closesocket(s) close(s)
+# define O_BINARY 0
 #endif
 
 #include <sys/types.h>
@@ -329,4 +331,9 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err);
 #define max(x,y) ((x) > (y) ? (x) : (y))
 #endif
 
+#ifdef _WIN32
+#undef errno
+#define errno (WSAGetLastError())
+#endif
+
 #endif