|
| 1 | +From 1f8def9f776a7dd0d0381f4bf25e84f805393cc1 Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?Radek=20Barto=C5=88?= < [email protected]> |
| 3 | +Date: Mon, 9 Jun 2025 18:14:14 +0200 |
| 4 | +Subject: [PATCH 48/N] Cygwin: Fix compatibility with w32api headers v13 |
| 5 | + |
| 6 | +(cherry picked from commit 2029784e05d9805aa074dcadb99c31311790b7ac) |
| 7 | +--- |
| 8 | + winsup/cygwin/fhandler/socket_inet.cc | 5 +++++ |
| 9 | + winsup/cygwin/fhandler/socket_local.cc | 5 +++++ |
| 10 | + winsup/cygwin/local_includes/ntdll.h | 4 ++++ |
| 11 | + winsup/cygwin/net.cc | 5 +++++ |
| 12 | + 4 files changed, 19 insertions(+) |
| 13 | + |
| 14 | +diff --git a/winsup/cygwin/fhandler/socket_inet.cc b/winsup/cygwin/fhandler/socket_inet.cc |
| 15 | +index 22dfed6..5ed0cb0 100644 |
| 16 | +--- a/winsup/cygwin/fhandler/socket_inet.cc |
| 17 | ++++ b/winsup/cygwin/fhandler/socket_inet.cc |
| 18 | +@@ -20,7 +20,12 @@ |
| 19 | + #undef u_long |
| 20 | + #define u_long __ms_u_long |
| 21 | + #include <w32api/ws2tcpip.h> |
| 22 | ++/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with |
| 23 | ++ our socket.h. Arrange not to see it here. */ |
| 24 | ++#undef cmsghdr |
| 25 | ++#define cmsghdr __ms_cmsghdr |
| 26 | + #include <w32api/mswsock.h> |
| 27 | ++#undef cmsghdr |
| 28 | + #include <w32api/mstcpip.h> |
| 29 | + #include <netinet/tcp.h> |
| 30 | + #include <netinet/udp.h> |
| 31 | +diff --git a/winsup/cygwin/fhandler/socket_local.cc b/winsup/cygwin/fhandler/socket_local.cc |
| 32 | +index ea5ee67..0498edc 100644 |
| 33 | +--- a/winsup/cygwin/fhandler/socket_local.cc |
| 34 | ++++ b/winsup/cygwin/fhandler/socket_local.cc |
| 35 | +@@ -21,7 +21,12 @@ |
| 36 | + #define u_long __ms_u_long |
| 37 | + #include "ntsecapi.h" |
| 38 | + #include <w32api/ws2tcpip.h> |
| 39 | ++/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with |
| 40 | ++ our socket.h. Arrange not to see it here. */ |
| 41 | ++#undef cmsghdr |
| 42 | ++#define cmsghdr __ms_cmsghdr |
| 43 | + #include <w32api/mswsock.h> |
| 44 | ++#undef cmsghdr |
| 45 | + #include <unistd.h> |
| 46 | + #include <asm/byteorder.h> |
| 47 | + #include <sys/socket.h> |
| 48 | +diff --git a/winsup/cygwin/local_includes/ntdll.h b/winsup/cygwin/local_includes/ntdll.h |
| 49 | +index 4497fe5..2991672 100644 |
| 50 | +--- a/winsup/cygwin/local_includes/ntdll.h |
| 51 | ++++ b/winsup/cygwin/local_includes/ntdll.h |
| 52 | +@@ -489,6 +489,8 @@ typedef struct _FILE_DISPOSITION_INFORMATION_EX // 64 |
| 53 | + ULONG Flags; |
| 54 | + } FILE_DISPOSITION_INFORMATION_EX, *PFILE_DISPOSITION_INFORMATION_EX; |
| 55 | + |
| 56 | ++#if __MINGW64_VERSION_MAJOR < 13 |
| 57 | ++ |
| 58 | + typedef struct _FILE_STAT_INFORMATION // 68 |
| 59 | + { |
| 60 | + LARGE_INTEGER FileId; |
| 61 | +@@ -509,6 +511,8 @@ typedef struct _FILE_CASE_SENSITIVE_INFORMATION // 71 |
| 62 | + ULONG Flags; |
| 63 | + } FILE_CASE_SENSITIVE_INFORMATION, *PFILE_CASE_SENSITIVE_INFORMATION; |
| 64 | + |
| 65 | ++#endif |
| 66 | ++ |
| 67 | + enum { |
| 68 | + FILE_LINK_REPLACE_IF_EXISTS = 0x01, |
| 69 | + FILE_LINK_POSIX_SEMANTICS = 0x02, |
| 70 | +diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc |
| 71 | +index 9d7224a..579b1a7 100644 |
| 72 | +--- a/winsup/cygwin/net.cc |
| 73 | ++++ b/winsup/cygwin/net.cc |
| 74 | +@@ -18,7 +18,12 @@ details. */ |
| 75 | + #undef u_long |
| 76 | + #define u_long __ms_u_long |
| 77 | + #include <w32api/ws2tcpip.h> |
| 78 | ++/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with |
| 79 | ++ our socket.h. Arrange not to see it here. */ |
| 80 | ++#undef cmsghdr |
| 81 | ++#define cmsghdr __ms_cmsghdr |
| 82 | + #include <w32api/mswsock.h> |
| 83 | ++#undef cmsghdr |
| 84 | + #include <w32api/iphlpapi.h> |
| 85 | + #define gethostname cygwin_gethostname |
| 86 | + #include <unistd.h> |
0 commit comments