Enable compilation on Windows CE
Add a few ifdefs to support this additional platform.
This commit is contained in:
parent
cd9d6c5149
commit
5b71aac2ed
2 changed files with 17 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue