Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitri Tikhonov committed Oct 7, 2020
1 parent e55a450 commit 464a1af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion src/liblsquic/lsquic_handshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <netinet/in.h>
#include <netdb.h>
#include <sys/socket.h>
#else
#include <malloc.h>
#endif

#include <openssl/ssl.h>
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_h3_framing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 464a1af

Please sign in to comment.