mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
libuv win32 fixes
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
02ff145f50
commit
bbcd24167f
3 changed files with 19 additions and 4 deletions
|
@ -955,7 +955,7 @@ if (NOT LWS_WITHOUT_TESTAPPS)
|
|||
"test-server/test-server-status.c"
|
||||
"test-server/test-server-echogen.c")
|
||||
endif()
|
||||
if (UNIX AND NOT ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
if (NOT ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
AND LWS_WITH_LIBEV)
|
||||
create_test_app(test-server-libev
|
||||
"test-server/test-server-libev.c"
|
||||
|
@ -965,7 +965,7 @@ if (NOT LWS_WITHOUT_TESTAPPS)
|
|||
"test-server/test-server-status.c"
|
||||
"test-server/test-server-echogen.c")
|
||||
endif()
|
||||
if (UNIX AND NOT ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
if (NOT ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
AND LWS_WITH_LIBUV)
|
||||
create_test_app(test-server-libuv
|
||||
"test-server/test-server-libuv.c"
|
||||
|
|
13
lib/libuv.c
13
lib/libuv.c
|
@ -38,7 +38,11 @@ lws_io_cb(uv_poll_t *watcher, int status, int revents)
|
|||
struct lws_context *context = lws_io->context;
|
||||
struct lws_pollfd eventfd;
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
eventfd.fd = watcher->sock;
|
||||
#else
|
||||
eventfd.fd = watcher->io_watcher.fd;
|
||||
#endif
|
||||
eventfd.events = 0;
|
||||
eventfd.revents = 0;
|
||||
|
||||
|
@ -207,8 +211,13 @@ lws_libuv_io(struct lws *wsi, int flags)
|
|||
{
|
||||
struct lws_context *context = lws_get_context(wsi);
|
||||
struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi];
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
int current_events = wsi->w_read.uv_watcher.io.events &
|
||||
(UV_READABLE | UV_WRITABLE);
|
||||
#else
|
||||
int current_events = wsi->w_read.uv_watcher.io_watcher.pevents &
|
||||
(UV_READABLE | UV_WRITABLE);
|
||||
#endif
|
||||
struct lws_io_watcher *w = &wsi->w_read;
|
||||
|
||||
if (!LWS_LIBUV_ENABLED(context))
|
||||
|
@ -329,8 +338,8 @@ lws_uv_getloop(struct lws_context *context, int tsi)
|
|||
static void
|
||||
lws_libuv_closewsi(uv_handle_t* handle)
|
||||
{
|
||||
struct lws *n = NULL, *wsi = (struct lws *)(((void *)handle) -
|
||||
(void *)(&n->w_read.uv_watcher));
|
||||
struct lws *n = NULL, *wsi = (struct lws *)(((char *)handle) -
|
||||
(char *)(&n->w_read.uv_watcher));
|
||||
struct lws_context *context = lws_get_context(wsi);
|
||||
|
||||
lws_close_free_wsi_final(wsi);
|
||||
|
|
|
@ -261,6 +261,12 @@ typedef unsigned __int64 u_int64_t;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef container_of
|
||||
#define container_of(P,T,M) ((T *)((char *)(P) - offsetof(T, M)))
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
|
Loading…
Add table
Reference in a new issue