Commit 173e9c4e made LWS_SEND_BUFFER_SIZE a multiple of a certain
value returned by _LWS_PAD_SIZE macro. This macro expanded to
"sizeof(void *)" on non-x86_64 architectures, which made it
unsuitable to use LWS_SEND_BUFFER_SIZE in preprocessor #if
expressions in the library user code.
This patch preserves the padding logic since commit 173e9c4e but
makes it more preprocessor-friendly for applications using
libwebsockets by setting _LWS_PAD_SIZE to the size of "void *"
determined by cmake when libwebsockets is configured for the
target platform.
Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
is no problem on a unix system with sys/types.h
However on Windows it will result in a #undef pid_t ... When libwebsockets is used with pthreads32 which typedefs pid_t itself, it will fail to build with some weird errors.
Also since we're exporitng these macros to the entire world via libwebsockets.h we should not define a VERSION macro. Which is defined improperly anyway.
Since we include lws_config.h in the public headers, at least our HAVE_ macros should be kind of unique, so that we don't get redefinitions when used with other libraries using config files as well.
This patch lets libwebsockets use the lastest version of wolfSSL (the new name for CyaSSL).
The reason for the patch is that allthough wolfSSL provides compatibility headers for (old) projects using CyaSSL,
these are incomplete and do not work for libwebsockets.
The patch also fixes a typo in CMakeLists.txt where CYASSL_LIBRARIES was added to include_directories() instead of CYASSL_INCLUDE_DIRS.
Signed-off-by: ABruines <alexander.bruines@gmail.com>
* Default CMAKE_BUILD_TYPE to Release
* Use CMAKE_BUILD_TYPE to define _DEBUG (NDEBUG is more standard though,
but cmake defines it)
* Drop LWS_WITHOUT_DEBUG (use CMAKE_BUILD_TYPE for that)
* Drop LWS_NO_EXTERNAL_POLL (was not used)
* Drop CMAKE_BUILD (CMake is the only build system now)
* Add LWS_WITH_STATIC and LWS_WITH_SHARED to choose what version(s) to
build
* Add LWS_XXX_LIBRARIES and LWS_XXX_INCLUDE_DIRS for each library
dependency (zlib, openssl, libev, cyassl)
* Support setting of XXX_LIBRARIES, XXX_LIBRARIES and XXX_INCLUDE_DIRS
by parent project (when included with add_subdirectory())
* Rename LWS_USE_EXTERNAL_ZLIB to LWS_USE_BUNDLED_ZLIB and default it to
NO (since it's Windows only)
* Default LWS_WITHOUT_DAEMONIZE to NO (since network lib shouldn't know
how to do it anyway)
* Rename config.h.cmake to lws_config.h.in
* Rename shared library to websockets_shared so linker will not be
confused
* Fix inline keyword detection in clang
* Explicitly set MACOSX_RPATH to YES on MacOS