Fix Windows build

This commit is contained in:
Dmitri Tikhonov 2020-10-07 11:05:18 -04:00
parent e55a45021d
commit 464a1af9c4
3 changed files with 6 additions and 3 deletions

View File

@ -103,6 +103,7 @@ SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4334") # result of 32-bit shift implici
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4456") # hide previous local declaration
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4459") # hide global declaration
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4706") # assignment within conditional expression
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4090") # different 'const' qualifier (TODO: debug ls-sfparser.c)
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -W4 -WX -Zi -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -I${CMAKE_CURRENT_SOURCE_DIR}/wincompat")
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -Od")

View File

@ -11,6 +11,8 @@
#include <netinet/in.h>
#include <netdb.h>
#include <sys/socket.h>
#else
#include <malloc.h>
#endif
#include <openssl/ssl.h>
@ -1977,7 +1979,7 @@ gen_rej1_data (struct lsquic_enc_session *enc_session, uint8_t *data,
#ifndef WIN32
char prof_buf[prof_len];
#else
prof_buf = _malloca(prof_len);
char *prof_buf = _malloca(prof_len);
if (!prof_buf)
return -1;
#endif

View File

@ -1223,11 +1223,11 @@ test_frame_header_split (unsigned n_packets, unsigned extra_sz,
const ssize_t w = lsquic_stream_write(stream, buf_in, buf_in_sz);
assert(w >= 0 && (size_t) w == buf_in_sz);
n_frames = count_hq_frames(stream);
assert(n_frames == 1 + (w > 0));
assert((int) n_frames == 1 + (w > 0));
lsquic_stream_flush(stream);
n_frames = count_hq_frames(stream);
assert(n_frames == !!stream->sm_n_buffered);
assert((int) n_frames == !!stream->sm_n_buffered);
if (add_one_more)
{