From e680fb9193a6725b053762eca0a26f846d6f197a Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 17 Jan 2017 06:51:11 +0800 Subject: [PATCH] win32 fixes https://github.com/warmcat/libwebsockets/issues/750 --- lib/lws-plat-win.c | 2 ++ lib/service.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/lws-plat-win.c b/lib/lws-plat-win.c index fa34037c0..52b64edb1 100644 --- a/lib/lws-plat-win.c +++ b/lib/lws-plat-win.c @@ -6,7 +6,9 @@ unsigned long long time_in_microseconds() { +#ifndef DELTA_EPOCH_IN_MICROSECS #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL +#endif FILETIME filetime; ULARGE_INTEGER datetime; diff --git a/lib/service.c b/lib/service.c index fd9456259..7f5aa7a34 100644 --- a/lib/service.c +++ b/lib/service.c @@ -695,7 +695,7 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t lws_plat_service_periodic(context); /* retire unused deprecated context */ -#if LWS_POSIX +#if LWS_POSIX && !defined(_WIN32) if (context->deprecated && !context->count_wsi_allocated) { lwsl_notice("%s: ending deprecated context\n", __func__); kill(getpid(), SIGINT); @@ -744,9 +744,9 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t if (context->ws_ping_pong_interval && context->last_ws_ping_pong_check_s < now + 10) { + struct lws_vhost *vh = context->vhost_list; context->last_ws_ping_pong_check_s = now; - struct lws_vhost *vh = context->vhost_list; while (vh) { for (n = 0; n < vh->count_protocols; n++) { wsi = vh->same_vh_protocol_list[n];