1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

Enable compilation on Windows CE

Add a few ifdefs to support this additional platform.
This commit is contained in:
Patrick Gansterer 2014-02-28 01:31:39 +01:00 committed by Andy Green
parent cd9d6c5149
commit 5b71aac2ed
2 changed files with 17 additions and 1 deletions

View file

@ -454,7 +454,9 @@ endif(LWS_WITH_SSL)
#
# Platform specific libs.
#
if (WIN32)
if (WINCE)
list(APPEND LIB_LIST ws2.lib)
elseif (WIN32)
list(APPEND LIB_LIST ws2_32.lib)
endif()

View file

@ -24,6 +24,9 @@
#if defined(WIN32) || defined(_WIN32)
#include <tchar.h>
#include <mstcpip.h>
#ifdef _WIN32_WCE
#define vsnprintf _vsnprintf
#endif
#else
#ifdef LWS_BUILTIN_GETIFADDRS
#include <getifaddrs.h>
@ -140,6 +143,15 @@ static unsigned long long time_in_microseconds()
#endif
}
#ifdef _WIN32_WCE
static inline time_t time(time_t *t)
{
time_t ret = time_in_microseconds() / 1000000;
*t = ret;
return ret;
}
#endif
int
insert_wsi_socket_into_fds(struct libwebsocket_context *context,
struct libwebsocket *wsi)
@ -1974,6 +1986,7 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
/* default to a poll() made out of select() */
poll = emulated_poll;
#ifndef _WIN32_WCE
/* if windows socket lib available, use his WSAPoll */
wsdll = GetModuleHandle(_T("Ws2_32.dll"));
if (wsdll)
@ -1982,6 +1995,7 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
/* Finally fall back to emulated poll if all else fails */
if (!poll)
poll = emulated_poll;
#endif
}
#endif