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

@@ -420,7 +420,7 @@ int zts_start(const char *path, bool blocking = false)
if (path) {
homeDir = path;
}
int err;
int err = 0;
#if defined(_WIN32)
WSAStartup(MAKEWORD(2, 2), &wsaData); // initialize WinSock. Used in Phy for loopback pipe
HANDLE thr = CreateThread(NULL, 0, zts_start_service, NULL, 0, NULL);
@@ -431,6 +431,7 @@ int zts_start(const char *path, bool blocking = false)
if (blocking) { // block to prevent service calls before we're ready
ZT_NodeStatus status;
status.online = 0;
while (zts_core_running() == false || zt1Service->getNode() == NULL) {
api_sleep(ZTO_WRAPPER_CHECK_INTERVAL);
}

View File

@@ -674,14 +674,20 @@ int platform_adjusted_socket_family(int family)
return family == 30 ? AF_INET6 : family; // 10
#endif
#if defined(_WIN32)
return family == 23 ? AF_INET6 : family; // 10
if (family == 23) {
return AF_INET6;
}
if (family == 2) {
return AF_INET;
}
family; // 10
#endif
}
void fix_addr_socket_family(struct sockaddr *addr)
{
#if defined(__linux__)
/* linux's socket.h's sockaddr definition doesn't contain an sa_len field
#if defined(__linux__) || defined(_WIN32)
/* struct sockaddr on Linux and Windows don't contain an sa_len field
so we must adjust it here before feeding it into the stack. */
#if defined(STACK_LWIP)
if (addr->sa_len == 2) {

View File

@@ -118,7 +118,7 @@ static void main_thread(void *arg)
sys_sem_t sem;
LWIP_UNUSED_ARG(arg);
if (sys_sem_new(&sem, 0) != ERR_OK) {
DEBUG_ERROR("failed to create semaphore", 0);
DEBUG_ERROR("failed to create semaphore");
}
tcpip_init(tcpip_init_done, &sem);
sys_sem_wait(&sem);