Skip to content

Commit 7213f16

Browse files
committed
Fix Windows CI: force-include wincompat.h for ssize_t and Winsock types
Using /I path wasn't enough — picoquic_packet_loop.h uses ssize_t before wincompat.h gets included. Use /FI to force-include wincompat.h (and ws2tcpip.h) before all source files, ensuring ssize_t, Winsock2, and IPv6 types are always defined.
1 parent 50ecaa8 commit 7213f16

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

app/src/main/rust/slipstream-rust/scripts/build_picoquic.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ if [[ -n "${CMAKE_OSX_ARCHITECTURES:-}" ]]; then
7070
CMAKE_ARGS+=("-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}")
7171
fi
7272

73-
# Windows: picotls.h includes "wincompat.h" which lives in picoquic's source
74-
# directory, and picotls uses sockaddr_in6/inet_pton which need <ws2tcpip.h>.
75-
# Add the include path and the missing header via CMAKE_C_FLAGS_INIT.
73+
# Windows: force-include wincompat.h (provides ssize_t, Winsock2.h) and
74+
# ws2tcpip.h (provides sockaddr_in6, inet_pton) before any source file.
75+
# This ensures all picoquic and picotls headers see these definitions.
7676
if [[ "${OS:-}" == "Windows_NT" ]] || [[ "$(uname -s 2>/dev/null)" == MINGW* ]]; then
77-
WINCOMPAT_DIR="${PICOQUIC_DIR}/picoquic"
77+
WINCOMPAT_H="${PICOQUIC_DIR}/picoquic/wincompat.h"
7878
if command -v cygpath &>/dev/null; then
79-
WINCOMPAT_DIR="$(cygpath -w "${WINCOMPAT_DIR}")"
79+
WINCOMPAT_H="$(cygpath -w "${WINCOMPAT_H}")"
8080
fi
81-
CMAKE_ARGS+=("-DCMAKE_C_FLAGS_INIT=/I\"${WINCOMPAT_DIR}\" /FI\"ws2tcpip.h\"")
81+
CMAKE_ARGS+=("-DCMAKE_C_FLAGS_INIT=/FI\"${WINCOMPAT_H}\" /FI\"ws2tcpip.h\"")
8282
fi
8383

8484
if [[ -n "${OPENSSL_ROOT_DIR:-}" ]]; then

0 commit comments

Comments
 (0)