diff --git a/core/deps/libwebsocket/context.c b/core/deps/libwebsocket/context.c index bf9b6cb73..c63ab271c 100644 --- a/core/deps/libwebsocket/context.c +++ b/core/deps/libwebsocket/context.c @@ -25,6 +25,10 @@ #define LWS_BUILD_HASH "unknown-build-hash" #endif +#ifdef WIN32 +#define getdtablesize() 30000 +#endif + static const char *library_version = LWS_LIBRARY_VERSION " " LWS_BUILD_HASH; /** @@ -122,7 +126,11 @@ libwebsocket_create_context(struct lws_context_creation_info *info) context->options = info->options; context->iface = info->iface; /* to reduce this allocation, */ +#ifdef WIN32 + context->max_fds = getdtablesize (); +#else context->max_fds = sysconf(_SC_OPEN_MAX); +#endif lwsl_notice(" static allocation: %u + (%u x %u fds) = %u bytes\n", sizeof(struct libwebsocket_context), sizeof(struct libwebsocket_pollfd) + diff --git a/core/emitter/x86_emitter.h b/core/emitter/x86_emitter.h index 45727822a..ca0598beb 100644 --- a/core/emitter/x86_emitter.h +++ b/core/emitter/x86_emitter.h @@ -229,11 +229,13 @@ struct /*__declspec(dllexport)*/ x86_ptr_imm this->ptr=ptr; } +#ifndef WIN32 template x86_ptr_imm(Rv(* ptr)(Args...)) { this->ptr= reinterpret_cast(ptr); } +#endif template x86_ptr_imm(Rv(DYNACALL * ptr)(Args...))