Skip to content

Commit 1f8def9

Browse files
Blackhexlazka
authored andcommitted
Cygwin: Fix compatibility with w32api headers v13
(cherry picked from commit 2029784e05d9805aa074dcadb99c31311790b7ac)
1 parent e3e73ed commit 1f8def9

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

winsup/cygwin/fhandler/socket_inet.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
#undef u_long
2121
#define u_long __ms_u_long
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/mstcpip.h>
2530
#include <netinet/tcp.h>
2631
#include <netinet/udp.h>

winsup/cygwin/fhandler/socket_local.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
#define u_long __ms_u_long
2222
#include "ntsecapi.h"
2323
#include <w32api/ws2tcpip.h>
24+
/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with
25+
our socket.h. Arrange not to see it here. */
26+
#undef cmsghdr
27+
#define cmsghdr __ms_cmsghdr
2428
#include <w32api/mswsock.h>
29+
#undef cmsghdr
2530
#include <unistd.h>
2631
#include <asm/byteorder.h>
2732
#include <sys/socket.h>

winsup/cygwin/local_includes/ntdll.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ typedef struct _FILE_DISPOSITION_INFORMATION_EX // 64
489489
ULONG Flags;
490490
} FILE_DISPOSITION_INFORMATION_EX, *PFILE_DISPOSITION_INFORMATION_EX;
491491

492+
#if __MINGW64_VERSION_MAJOR < 13
493+
492494
typedef struct _FILE_STAT_INFORMATION // 68
493495
{
494496
LARGE_INTEGER FileId;
@@ -509,6 +511,8 @@ typedef struct _FILE_CASE_SENSITIVE_INFORMATION // 71
509511
ULONG Flags;
510512
} FILE_CASE_SENSITIVE_INFORMATION, *PFILE_CASE_SENSITIVE_INFORMATION;
511513

514+
#endif
515+
512516
enum {
513517
FILE_LINK_REPLACE_IF_EXISTS = 0x01,
514518
FILE_LINK_POSIX_SEMANTICS = 0x02,

winsup/cygwin/net.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ details. */
1818
#undef u_long
1919
#define u_long __ms_u_long
2020
#include <w32api/ws2tcpip.h>
21+
/* 2025-06-09: win32api headers v13 now define a cmsghdr type which clashes with
22+
our socket.h. Arrange not to see it here. */
23+
#undef cmsghdr
24+
#define cmsghdr __ms_cmsghdr
2125
#include <w32api/mswsock.h>
26+
#undef cmsghdr
2227
#include <w32api/iphlpapi.h>
2328
#define gethostname cygwin_gethostname
2429
#include <unistd.h>

0 commit comments

Comments
 (0)