1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

cmake: Fix bzero mis-detection on MinGW

Using a C compiler ignores non-existent functions, and tries to link them anyway.

The compiler optimizes `bzero(buf, 1)` to `movb   $0x0,0xf(%esp)`, so bzero is
not called at all, and the linker succeeds.

Increase the buffer size to 100 to avoid this optimization.
This commit is contained in:
elivdahan 2019-04-01 09:38:20 +03:00 committed by Andy Green
parent fd1f4e4de7
commit 1d6128d1fe

View file

@ -723,7 +723,7 @@ endif()
CHECK_C_SOURCE_COMPILES(
"#include <strings.h>
int main(int argc, char **argv) { char buf[1]; bzero(buf, 1); return 0; }
int main(int argc, char **argv) { char buf[100]; bzero(buf, 100); return 0; }
" LWS_HAVE_BZERO)
CHECK_C_SOURCE_COMPILES(
"#include <malloc.h>