Windows cmake build updates

This commit is contained in:
joseph.henry
2018-01-31 17:05:23 -08:00
parent 2c5634343a
commit f03f4098c5
6 changed files with 350 additions and 293 deletions

View File

@@ -25,10 +25,10 @@
*/
#if defined(__linux__) || defined(__APPLE__)
#include <netdb.h>
#include <netdb.h>
#include <unistd.h>
#endif
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -43,6 +43,14 @@
#include "RingBuffer.h"
#include "ztproxy.hpp"
#if defined(_WIN32)
#include <time.h>
void sleep(unsigned long ms)
{
Sleep(ms);
}
#endif
namespace ZeroTier {
typedef void PhySocket;
@@ -329,7 +337,11 @@ namespace ZeroTier {
delete conn;
conn = NULL;
}
#if defined(_WIN32)
closesocket(_phy.getDescriptor(sock));
#else
close(_phy.getDescriptor(sock));
#endif
conn_m.unlock();
}