diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-07-12 22:33:07 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-07-12 22:33:07 +0000 |
commit | 57c3d6480861f11f1558708967fc58e3a80da2b4 (patch) | |
tree | 0814d528e6c2f2dae157a17ec825d52db6a4f992 /slirp.h | |
parent | 25267a3cd019af1e37e200977d28f357c4a4ea14 (diff) | |
download | slirp-57c3d6480861f11f1558708967fc58e3a80da2b4.zip slirp-57c3d6480861f11f1558708967fc58e3a80da2b4.tar.gz slirp-57c3d6480861f11f1558708967fc58e3a80da2b4.tar.bz2 |
win32 compile
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1016 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp.h')
-rw-r--r-- | slirp.h | 38 |
1 files changed, 37 insertions, 1 deletions
@@ -11,6 +11,30 @@ #include "config.h" #include "slirp_config.h" +#ifdef _WIN32 +#include <inttypes.h> + +typedef uint8_t u_int8_t; +typedef uint16_t u_int16_t; +typedef uint32_t u_int32_t; +typedef uint64_t u_int64_t; +typedef char *caddr_t; + +#include <winsock2.h> +#include <sys/timeb.h> +#include <iphlpapi.h> + +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EINPROGRESS WSAEINPROGRESS +#define ENOTCONN WSAENOTCONN +#define EHOSTUNREACH WSAEHOSTUNREACH +#define ENETUNREACH WSAENETUNREACH +#define ECONNREFUSED WSAECONNREFUSED +#else +#define ioctlsocket ioctl +#define closesocket(s) close(s) +#endif + #include <sys/types.h> #ifdef HAVE_SYS_BITYPES_H #include <sys/bitypes.h> @@ -79,7 +103,9 @@ typedef unsigned int u_int32_t; #include <strings.h> #endif +#ifndef _WIN32 #include <sys/uio.h> +#endif #ifndef _P #ifndef NO_PROTOTYPES @@ -89,8 +115,10 @@ typedef unsigned int u_int32_t; #endif #endif +#ifndef _WIN32 #include <netinet/in.h> #include <arpa/inet.h> +#endif #ifdef GETTIMEOFDAY_ONE_ARG #define gettimeofday(x, y) gettimeofday(x) @@ -119,7 +147,9 @@ int inet_aton _P((const char *cp, struct in_addr *ia)); #ifdef HAVE_SYS_SIGNAL_H #include <sys/signal.h> #endif +#ifndef _WIN32 #include <sys/socket.h> +#endif #if defined(HAVE_SYS_IOCTL_H) #include <sys/ioctl.h> @@ -232,8 +262,9 @@ inline void insque_32 _P((void *, void *)); inline void remque_32 _P((void *)); #endif -#include <pwd.h> +#ifndef _WIN32 #include <netdb.h> +#endif #define DEFAULT_BAUD 115200 @@ -294,4 +325,9 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err); #define MAX_MRU 16384 #endif +#ifndef _WIN32 +#define min(x, y) ((x) < (y) ? (x) : (y)) +#define max(x, y) ((x) > (y) ? (x) : (y)) +#endif + #endif |