diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-04-30 22:53:25 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-04-30 22:53:25 +0000 |
commit | 6ca957f08f272321e32ccef2f4053e93dc10f4ad (patch) | |
tree | 8c061b32dda461926dab9d5ac366668461755228 /qemu_socket.h | |
parent | f3548328783d49bb3f22c16b644b1156361e6678 (diff) |
win32 socket fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1876 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu_socket.h')
-rw-r--r-- | qemu_socket.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/qemu_socket.h b/qemu_socket.h new file mode 100644 index 0000000000..64b7d4e5ef --- /dev/null +++ b/qemu_socket.h @@ -0,0 +1,30 @@ +/* headers to use the BSD sockets */ +#ifndef QEMU_SOCKET_H +#define QEMU_SOCKET_H + +#ifdef _WIN32 + +#include <windows.h> +#include <winsock2.h> +#include <ws2tcpip.h> + +#define socket_error() WSAGetLastError() +#undef EINTR +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EINTR WSAEINTR +#define EINPROGRESS WSAEINPROGRESS + +#else + +#include <sys/socket.h> +#include <netinet/in.h> +#include <netinet/tcp.h> + +#define socket_error() errno +#define closesocket(s) close(s) + +#endif /* !_WIN32 */ + +void socket_set_nonblock(int fd); + +#endif /* QEMU_SOCKET_H */ |