diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index cb2b09bae..7ebc0f694 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -987,11 +987,13 @@ lwsl_timestamp(int level, char *p, int len) #endif int n; +#ifndef _WIN32_WCE #ifdef WIN32 ptm = localtime(&o_now); #else if (localtime_r(&o_now, &tm)) ptm = &tm; +#endif #endif p[0] = '\0'; for (n = 0; n < LLL_COUNT; n++) { diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 6bb4a80a6..f38fc567a 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -114,9 +114,18 @@ struct sockaddr_in; #include #include #include +#ifndef _WIN32_WCE #include +#else +#define _O_RDONLY 0x0000 +#define O_RDONLY _O_RDONLY +#endif +#ifdef _WIN32_WCE +#define strcasecmp _stricmp +#else #define strcasecmp stricmp +#endif #define getdtablesize() 30000 #define LWS_INLINE __inline diff --git a/lib/lws-plat-win.c b/lib/lws-plat-win.c index 6d731fc0f..cec976668 100644 --- a/lib/lws-plat-win.c +++ b/lib/lws-plat-win.c @@ -291,7 +291,11 @@ lws_plat_set_socket_options(struct lws_context *context, lws_sockfd_type fd) /* Disable Nagle */ optval = 1; +#ifndef _WIN32_WCE tcp_proto = getprotobyname("TCP"); +#else + tcp_proto = 6; +#endif if (!tcp_proto) { lwsl_err("getprotobyname() failed with error %d\n", LWS_ERRNO); return 1;