From beabeb4e6a687581fe009d2a4d05a54cb6dd9bf4 Mon Sep 17 00:00:00 2001 From: Jeremy Drake Date: Wed, 11 Jun 2025 12:56:22 -0700 Subject: [PATCH] msys2-runtime-3.4: update patch for w32api 13 support --- ...ompatibility-with-w32api-headers-v13.patch | 86 +++++++++++++++++++ msys2-runtime-3.4/PKGBUILD | 11 ++- 2 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 msys2-runtime-3.4/0064-Cygwin-Fix-compatibility-with-w32api-headers-v13.patch diff --git a/msys2-runtime-3.4/0064-Cygwin-Fix-compatibility-with-w32api-headers-v13.patch b/msys2-runtime-3.4/0064-Cygwin-Fix-compatibility-with-w32api-headers-v13.patch new file mode 100644 index 00000000..617817cf --- /dev/null +++ b/msys2-runtime-3.4/0064-Cygwin-Fix-compatibility-with-w32api-headers-v13.patch @@ -0,0 +1,86 @@ +From 675702d95421a7f367d0c14e45063575eb97ff0f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Radek=20Barto=C5=88?= +Date: Mon, 9 Jun 2025 18:14:14 +0200 +Subject: [PATCH 64/N] Cygwin: Fix compatibility with w32api headers v13 + +(cherry picked from commit 2029784e05d9805aa074dcadb99c31311790b7ac) +--- + winsup/cygwin/fhandler/socket_inet.cc | 5 +++++ + winsup/cygwin/fhandler/socket_local.cc | 5 +++++ + winsup/cygwin/local_includes/ntdll.h | 4 ++++ + winsup/cygwin/net.cc | 5 +++++ + 4 files changed, 19 insertions(+) + +diff --git a/winsup/cygwin/fhandler/socket_inet.cc b/winsup/cygwin/fhandler/socket_inet.cc +index 63cc498..24db244 100644 +--- a/winsup/cygwin/fhandler/socket_inet.cc ++++ b/winsup/cygwin/fhandler/socket_inet.cc +@@ -20,7 +20,12 @@ + #undef u_long + #define u_long __ms_u_long + #include ++/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with ++ our socket.h. Arrange not to see it here. */ ++#undef cmsghdr ++#define cmsghdr __ms_cmsghdr + #include ++#undef cmsghdr + #include + #include + #include +diff --git a/winsup/cygwin/fhandler/socket_local.cc b/winsup/cygwin/fhandler/socket_local.cc +index e4a8816..72b0720 100644 +--- a/winsup/cygwin/fhandler/socket_local.cc ++++ b/winsup/cygwin/fhandler/socket_local.cc +@@ -21,7 +21,12 @@ + #define u_long __ms_u_long + #include "ntsecapi.h" + #include ++/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with ++ our socket.h. Arrange not to see it here. */ ++#undef cmsghdr ++#define cmsghdr __ms_cmsghdr + #include ++#undef cmsghdr + #include + #include + #include +diff --git a/winsup/cygwin/local_includes/ntdll.h b/winsup/cygwin/local_includes/ntdll.h +index aa1f3b9..f90a53b 100644 +--- a/winsup/cygwin/local_includes/ntdll.h ++++ b/winsup/cygwin/local_includes/ntdll.h +@@ -474,6 +474,8 @@ typedef struct _FILE_DISPOSITION_INFORMATION_EX // 64 + ULONG Flags; + } FILE_DISPOSITION_INFORMATION_EX, *PFILE_DISPOSITION_INFORMATION_EX; + ++#if __MINGW64_VERSION_MAJOR < 13 ++ + typedef struct _FILE_STAT_INFORMATION // 68 + { + LARGE_INTEGER FileId; +@@ -494,6 +496,8 @@ typedef struct _FILE_CASE_SENSITIVE_INFORMATION // 71 + ULONG Flags; + } FILE_CASE_SENSITIVE_INFORMATION, *PFILE_CASE_SENSITIVE_INFORMATION; + ++#endif ++ + enum { + FILE_LINK_REPLACE_IF_EXISTS = 0x01, + FILE_LINK_POSIX_SEMANTICS = 0x02, +diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc +index 8840d5e..c8f63be 100644 +--- a/winsup/cygwin/net.cc ++++ b/winsup/cygwin/net.cc +@@ -18,7 +18,12 @@ details. */ + #undef u_long + #define u_long __ms_u_long + #include ++/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with ++ our socket.h. Arrange not to see it here. */ ++#undef cmsghdr ++#define cmsghdr __ms_cmsghdr + #include ++#undef cmsghdr + #include + #define gethostname cygwin_gethostname + #include diff --git a/msys2-runtime-3.4/PKGBUILD b/msys2-runtime-3.4/PKGBUILD index 951305fe..3a22379e 100644 --- a/msys2-runtime-3.4/PKGBUILD +++ b/msys2-runtime-3.4/PKGBUILD @@ -4,7 +4,7 @@ pkgbase=msys2-runtime-3.4 pkgname=('msys2-runtime-3.4' 'msys2-runtime-3.4-devel') pkgver=3.4.10 -pkgrel=3 +pkgrel=4 pkgdesc="Cygwin POSIX emulation engine" arch=('x86_64') url="https://www.cygwin.com/" @@ -91,7 +91,8 @@ source=('msys2-runtime'::git://sourceware.org/git/newlib-cygwin.git#tag=cygwin-$ 0060-Cygwin-pipe-Give-up-to-use-query_hdl-for-non-cygwin-.patch 0061-Avoid-sharing-cygheaps-across-Cygwin-versions.patch 0062-uname-report-msys2-runtime-commit-hash-too.patch - 0063-Cygwin-suppress-a-warning-generated-with-w32api-12.0.patch) + 0063-Cygwin-suppress-a-warning-generated-with-w32api-12.0.patch + 0064-Cygwin-Fix-compatibility-with-w32api-headers-v13.patch) sha256sums=('a40476d03803bfa6875cde92221db4326b3479147e873fbeca2e4236d48fe875' '351bb1efdbdafe80c981e92d6b425c6ab71c85ce4e990db184e2118158eb2ab6' 'd3d3a01feeae9f7d5e6cb32f4662df74fc9476ff11a1aac3dad2df3e43fd88e4' @@ -155,7 +156,8 @@ sha256sums=('a40476d03803bfa6875cde92221db4326b3479147e873fbeca2e4236d48fe875' '45cf4e509845d27bf0d12bc6b878e8c2e33754e232a8d1de43ed7e19e451bfac' '80119c6ee0e8c44260ead25f2e0a9d0aa9f6ae244521541db3a53c424f9f72fd' 'f8210e329bb0cac0028c25a415755fe8a0b4339eaeb6f4117d9a7c6d0559579e' - '2ba10495562b73a44d50526c923b523dd3b38071b49a19d02ab5223a3684ff2c') + '2ba10495562b73a44d50526c923b523dd3b38071b49a19d02ab5223a3684ff2c' + '418c643b9195e25d9aba284de396afff8b4e168a0969a58816cfff6ae3a7519b') # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -255,7 +257,8 @@ prepare() { 0060-Cygwin-pipe-Give-up-to-use-query_hdl-for-non-cygwin-.patch \ 0061-Avoid-sharing-cygheaps-across-Cygwin-versions.patch \ 0062-uname-report-msys2-runtime-commit-hash-too.patch \ - 0063-Cygwin-suppress-a-warning-generated-with-w32api-12.0.patch + 0063-Cygwin-suppress-a-warning-generated-with-w32api-12.0.patch \ + 0064-Cygwin-Fix-compatibility-with-w32api-headers-v13.patch } build() {