Skip to content

Commit a56a9c7

Browse files
Blackhexjeremyd2019
authored andcommitted
Cygwin: Fix compatibility with w32api headers v13
(cherry picked from commit 2029784)
1 parent 5190927 commit a56a9c7

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

winsup/cygwin/fhandler_socket_inet.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
#define u_long __ms_u_long
2323
#endif
2424
#include <w32api/ws2tcpip.h>
25+
/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with
26+
our socket.h. Arrange not to see it here. */
27+
#undef cmsghdr
28+
#define cmsghdr __ms_cmsghdr
2529
#include <w32api/mswsock.h>
30+
#undef cmsghdr
2631
#include <w32api/mstcpip.h>
2732
#include <netinet/tcp.h>
2833
#include <unistd.h>

winsup/cygwin/fhandler_socket_local.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323
#endif
2424
#include "ntsecapi.h"
2525
#include <w32api/ws2tcpip.h>
26+
/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with
27+
our socket.h. Arrange not to see it here. */
28+
#undef cmsghdr
29+
#define cmsghdr __ms_cmsghdr
2630
#include <w32api/mswsock.h>
31+
#undef cmsghdr
2732
#include <unistd.h>
2833
#include <asm/byteorder.h>
2934
#include <sys/socket.h>

winsup/cygwin/net.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ details. */
2020
#define u_long __ms_u_long
2121
#endif
2222
#include <w32api/ws2tcpip.h>
23+
/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with
24+
our socket.h. Arrange not to see it here. */
25+
#undef cmsghdr
26+
#define cmsghdr __ms_cmsghdr
2327
#include <w32api/mswsock.h>
28+
#undef cmsghdr
2429
#include <w32api/iphlpapi.h>
2530
#define gethostname cygwin_gethostname
2631
#include <unistd.h>

winsup/cygwin/ntdll.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ typedef struct _FILE_DISPOSITION_INFORMATION_EX // 64
462462
ULONG Flags;
463463
} FILE_DISPOSITION_INFORMATION_EX, *PFILE_DISPOSITION_INFORMATION_EX;
464464

465+
#if __MINGW64_VERSION_MAJOR < 13
466+
465467
typedef struct _FILE_STAT_INFORMATION // 68
466468
{
467469
LARGE_INTEGER FileId;
@@ -482,6 +484,8 @@ typedef struct _FILE_CASE_SENSITIVE_INFORMATION // 71
482484
ULONG Flags;
483485
} FILE_CASE_SENSITIVE_INFORMATION, *PFILE_CASE_SENSITIVE_INFORMATION;
484486

487+
#endif
488+
485489
enum {
486490
FILE_LINK_REPLACE_IF_EXISTS = 0x01,
487491
FILE_LINK_POSIX_SEMANTICS = 0x02,

0 commit comments

Comments
 (0)