Fix windows (#51)

* More fixes for Windows

* fix tests for windows

* qf for linux

* clean up
This commit is contained in:
Dimon4eg authored and Benjamin Sergeant committed 2019-05-06 12:22:57 -07:00
1 parent 3b576c3047
commit 8ad47a315b
10 files changed
+64 -58

No files matched your search

+15 -2
View File
@@ -16,6 +16,20 @@
#ifdef _WIN32
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#undef EWOULDBLOCK
#undef EAGAIN
#undef EINPROGRESS
#undef EBADF
#undef EINVAL
// map to WSA error codes
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EAGAIN WSATRY_AGAIN
#define EINPROGRESS WSAEINPROGRESS
#define EBADF WSAEBADF
#define EINVAL WSAEINVAL
#endif
#include "IXCancellationRequest.h"
@@ -75,14 +89,13 @@ namespace ix
static int getErrno();
static bool isWaitNeeded();
static void closeSocket(int fd);
// Used as special codes for pipe communication
static const uint64_t kSendRequest;
static const uint64_t kCloseRequest;
protected:
void closeSocket(int fd);
std::atomic<int> _sockfd;
std::mutex _socketMutex;