Fix win32 so it works again

This commit is contained in:
Ronnie Sahlberg
2013-10-05 15:34:56 -07:00
parent 27b82512d5
commit d7b7c7727a
7 changed files with 50 additions and 10 deletions
+13
View File
@@ -32,13 +32,19 @@ THE SOFTWARE.
#include <Ws2ipdef.h>
#include <basetsd.h>
#include <io.h>
#include <malloc.h>
#include <sys/stat.h>
#define SOL_TCP IPPROTO_TCP
typedef int ssize_t;
typedef int uid_t;
typedef int gid_t;
typedef int socklen_t;
/* Wrapper macros to call misc. functions win32 is missing */
#define writev win32_writev
#define readv win32_readv
#define poll(x, y, z) win32_poll(x, y, z)
#define inet_pton(x,y,z) win32_inet_pton(x,y,z)
#define sleep(x) Sleep(x * 1000)
@@ -46,5 +52,12 @@ int win32_inet_pton(int af, const char * src, void * dst);
int win32_poll(struct pollfd *fds, unsigned int nfsd, int timeout);
int win32_gettimeofday(struct timeval *tv, struct timezone *tz);
struct iovec {
void *iov_base;
size_t iov_len;
};
#define inline
#endif//win32_COMPAT_H_
#endif//WIN32