From e5d4bc6d21ccc6483d66ea77b83d1612bce4cd84 Mon Sep 17 00:00:00 2001 From: Dmitri Tikhonov Date: Fri, 12 Apr 2019 14:31:08 -0400 Subject: [PATCH] Fix a couple of Windows compilation issues --- src/liblsquic/lsquic_parse_iquic_common.c | 11 +++++++++++ test/unittests/CMakeLists.txt | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/liblsquic/lsquic_parse_iquic_common.c b/src/liblsquic/lsquic_parse_iquic_common.c index 4b0b538..07a958a 100644 --- a/src/liblsquic/lsquic_parse_iquic_common.c +++ b/src/liblsquic/lsquic_parse_iquic_common.c @@ -75,7 +75,14 @@ lsquic_iquic_parse_packet_in_long_begin (lsquic_packet_in_t *packet_in, header_type = bits2ht[ (first_byte >> 4) & 3 ]; } else + { header_type = HETY_VERNEG; +#ifdef WIN32 + /* Useless initialization: */ + version = -1; +#endif + } + packet_in->pi_header_type = header_type; @@ -125,6 +132,10 @@ lsquic_iquic_parse_packet_in_long_begin (lsquic_packet_in_t *packet_in, /* Need at least one version in the version array: add 4 */ if (end - p < (ptrdiff_t) (dcil + scil + 4)) return -1; +#ifdef WIN32 + /* Useless initialization: */ + packet_len = 0; +#endif } memcpy(&packet_in->pi_conn_id, p, cid_len); diff --git a/test/unittests/CMakeLists.txt b/test/unittests/CMakeLists.txt index 5f55e4e..d80d794 100644 --- a/test/unittests/CMakeLists.txt +++ b/test/unittests/CMakeLists.txt @@ -38,7 +38,6 @@ SET(TESTS hkdf lsquic_hash malo - qlog packet_out packno_len parse_packet_in @@ -68,6 +67,11 @@ IF (CMAKE_SYSTEM_NAME STREQUAL "Linux") SET(TESTS ${TESTS} frame_rw) ENDIF() +IF (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") + # Linux has fmemopen + SET(TESTS ${TESTS} qlog) +ENDIF() + FOREACH(TEST_NAME ${TESTS}) ADD_EXECUTABLE(test_${TEST_NAME} test_${TEST_NAME}.c ${ADDL_SOURCES})