Skip to content

Commit d670e2e

Browse files
committed
CI PCP Win: patch rather than using old version
IP*PKTINFO is defined by the Mingw-w64 headers but the structs (eg. msghdr or cmsghdr) as defined in RFC 3542 seem to be called differently (WSAMSG, WSACMSGHDR). So the compat will be perhaps still required unless PCP adds support for Win structure names. The other changes are just fixing Win-specific headers (which may be fixed in PCP upstream eventually). Also moved dummy Git identity setting to enfironment.sh (is now needed also for MSW).
1 parent 2fbcf4f commit d670e2e

File tree

4 files changed

+74
-4
lines changed

4 files changed

+74
-4
lines changed

.github/scripts/Linux/prepare.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ LIBRARY_PATH=/usr/local/qt/lib\n\
77
PKG_CONFIG_PATH=$PKG_CONFIG_PATH\n" >> "$GITHUB_ENV"
88
printf "/usr/local/qt/bin\n" >> "$GITHUB_PATH"
99

10-
git config --global user.name "UltraGrid Builder"
11-
git config --global user.email "[email protected]"
12-
1310
# add deb-src for build-dep ffmpeg
1411
if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then # deb822 (new) format
1512
sudo sed -i 's/Types: deb/Types: deb deb-src/' \

.github/scripts/environment.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,5 @@ import_signing_key
138138

139139
printf '%b' 'DELTA_MAC_ARCHIVE=videomaster-macos-dev.tar.gz\n' >> "$GITHUB_ENV"
140140

141+
git config --global user.name "UltraGrid Builder"
142+
git config --global user.email "[email protected]"

.github/scripts/install-common-deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ install_pcp() {
108108
(
109109
cd pcp
110110
if is_win; then # TODO TOREMOVE: check if still needed
111-
git checkout ee50f35
111+
git am "$curdir"/pcp-win.patch
112112
fi
113113
./autogen.sh || true # autogen exits with 1
114114
CFLAGS=-fPIC ./configure --disable-shared

.github/scripts/pcp-win.patch

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
From fa588aa3ff7598df3df7f51a6f7e51a67a9378d8 Mon Sep 17 00:00:00 2001
2+
From: Martin Pulec <[email protected]>
3+
Date: Tue, 18 Mar 2025 12:39:21 +0100
4+
Subject: [PATCH] compat
5+
6+
---
7+
libpcp/src/net/pcp_socket.c | 5 +++++
8+
libpcp/src/pcp_client_db.h | 1 -
9+
libpcp/src/windows/pcp_gettimeofday.h | 2 ++
10+
libpcp/src/windows/pcp_win_defines.h | 2 +-
11+
4 files changed, 8 insertions(+), 2 deletions(-)
12+
13+
diff --git a/libpcp/src/net/pcp_socket.c b/libpcp/src/net/pcp_socket.c
14+
index fb4d002..2120846 100644
15+
--- a/libpcp/src/net/pcp_socket.c
16+
+++ b/libpcp/src/net/pcp_socket.c
17+
@@ -50,6 +50,11 @@
18+
#include "pcp_utils.h"
19+
#include "unp.h"
20+
21+
+
22+
+#undef IP_PKTINFO
23+
+#undef IPV6_PKTINFO
24+
+#undef IPV6_RECVPKTINFO
25+
+
26+
static PCP_SOCKET pcp_socket_create_impl(int domain, int type, int protocol);
27+
static ssize_t pcp_socket_recvfrom_impl(PCP_SOCKET sock, void *buf, size_t len,
28+
int flags, struct sockaddr *src_addr,
29+
diff --git a/libpcp/src/pcp_client_db.h b/libpcp/src/pcp_client_db.h
30+
index b5102c2..bf39de1 100644
31+
--- a/libpcp/src/pcp_client_db.h
32+
+++ b/libpcp/src/pcp_client_db.h
33+
@@ -29,7 +29,6 @@
34+
#include "pcp.h"
35+
#include "pcp_event_handler.h"
36+
#include "pcp_msg_structs.h"
37+
-#include <netinet/in.h>
38+
#include <stdint.h>
39+
#ifdef WIN32
40+
#include "pcp_win_defines.h"
41+
diff --git a/libpcp/src/windows/pcp_gettimeofday.h b/libpcp/src/windows/pcp_gettimeofday.h
42+
index fb6f4fa..9249de2 100644
43+
--- a/libpcp/src/windows/pcp_gettimeofday.h
44+
+++ b/libpcp/src/windows/pcp_gettimeofday.h
45+
@@ -26,6 +26,8 @@
46+
#ifndef PCP_GETTIMEOFDAY
47+
#define PCP_GETTIMEOFDAY
48+
49+
+struct timezone;
50+
+struct timeval;
51+
int gettimeofday(struct timeval *tv, struct timezone *tz);
52+
53+
#endif /*PCP_GETTIMEOFDAY*/
54+
diff --git a/libpcp/src/windows/pcp_win_defines.h b/libpcp/src/windows/pcp_win_defines.h
55+
index ae9987e..e24dad7 100644
56+
--- a/libpcp/src/windows/pcp_win_defines.h
57+
+++ b/libpcp/src/windows/pcp_win_defines.h
58+
@@ -28,9 +28,9 @@
59+
60+
#include "stdint.h"
61+
#include <time.h>
62+
-#include <winbase.h> /*GetCurrentProcessId*/ /*link with kernel32.dll*/
63+
#include <winsock2.h>
64+
#include <ws2ipdef.h>
65+
+#include <ws2def.h>
66+
#include <ws2tcpip.h>
67+
/* windows uses Sleep(miliseconds) method, instead of UNIX sleep(seconds) */
68+
#define sleep(x) Sleep((x)*1000)
69+
--
70+
2.48.1
71+

0 commit comments

Comments
 (0)