OCamlPro / directories

directories is an OCaml library that provides configuration, cache and data paths (and more!) following the suitable conventions on Linux, macOS and Windows. The following conventions are used: XDG Base Directory Specification and xdg-user-dirs on Linux, Known Folders on Windows, Standard Directories on macOS.
ISC License
33 stars 3 forks source link

NTDDI_VERSION setting conflicts with _WIN32_WINNT setting #14

Open jonahbeckford opened 1 year ago

jonahbeckford commented 1 year ago

I'm compiling this on Windows using DkML (MSVC distribution):

#=== ERROR while compiling directories.0.5 ====================================#
# context     2.2.0~alpha0~20221228 | win32/x86_64 | conf-withdkml.2 ocaml-system.4.14.0 | pinned(https://github.com/OCamlPro/directories/archive/0.5.tar.gz)
# path        C:\Users\beckf\AppData\Local\opam\playground\.opam-switch\build\directories.0.5
# command     C:\Users\beckf\AppData\Local\Programs\DISKUV~1\bin\WITH-D~1.EXE dune build -p directories -j 11 @install
# exit-code   1
# env-file    C:\Users\beckf\AppData\Local\opam\log\directories-24340-62faa2.env
# output-file C:\Users\beckf\AppData\Local\opam\log\directories-24340-62faa2.out
### output ###
# File "_build/.dune/default/src/windows/bindings/dune", line 37, characters 36-57:
# 37 |  (foreign_stubs (language c) (names win_functions_c_stubs))
#                                          ^^^^^^^^^^^^^^^^^^^^^
# (cd _build/default/src/windows/bindings && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD -I C:/Users/beckf/AppData/Local/Programs/DISKUV~1/lib/ocaml -I C:\Users\beckf\AppData\Local\opam\playground\lib\bigarray-compat -I C:\Users\beckf\AppData\Local\opam\playg[...]
# win_functions_c_stubs.c
# C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\sdkddkver.h(291): fatal error C1189: #error:  NTDDI_VERSION setting conflicts with _WIN32_WINNT setting

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build directories 0.5
└─
╶─ No changes have been performed

The important detail above is Windows SDK 10.0.18362.


I can't make sense of what the code is trying to do with cstubs. I believe https://github.com/OCamlPro/directories/blob/1cf7211f918fa909e5f77c0dfbb059c74071e99b/src/windows/bindings/gen_functions.ml#L25-L29 is doing the equivalent of:

#define NTDDI_VERSION NTDDI_VISTA

If that is true, then the code is missing the equivalent of:

#define _WIN32_WINNT _WIN32_WINNT_VISTA 

per (sometimes wrong) https://stackoverflow.com/questions/21030230/ntddi-version-setting-conflicts-with-win32-winnt-setting

zapashcanon commented 1 year ago

Hi @jonahbeckford,

Can you try with https://github.com/OCamlPro/directories/commit/441a35cdbd56641220e373e8ece1276e1754828b and tell me if it fixes the issue ?

jonahbeckford commented 1 year ago

opam pin directories.0.5 git+https://github.com/OCamlPro/directories.git#441a35cdbd56641220e373e8ece1276e1754828b changes the problem to something else:

File "_build/.dune/default/src/windows/bindings/dune", line 37, characters 36-57:
37 |  (foreign_stubs (language c) (names win_functions_c_stubs))
                                         ^^^^^^^^^^^^^^^^^^^^^
(cd _build/default/src/windows/bindings && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\cl.exe" -nologo -O2 -Gy- -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD -nologo -I C:/Users/beckf/AppData/Local/Programs/DISKUV~1/lib/ocaml -I Z:\source\test1\_opam\lib\bigarray-compat -I Z:\source\test1\_opam\lib\ctypes -I Z:\source\test1\_opam\lib\integers -I Z:\source\test1\_opam\lib\stdlib-shims -I . /Fowin_functions_c_stubs.obj -c win_functions_c_stubs.c)
win_functions_c_stubs.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(103): warning C4005: 'AF_IPX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(457): note: see previous definition of 'AF_IPX'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(140): warning C4005: 'AF_MAX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(476): note: see previous definition of 'AF_MAX'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(187): warning C4005: 'SO_DONTLINGER': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(399): note: see previous definition of 'SO_DONTLINGER'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(240): error C2011: 'sockaddr': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(482): note: see declaration of 'sockaddr'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(442): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(577): warning C4005: 'IN_CLASSA': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(284): note: see previous definition of 'IN_CLASSA'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(583): warning C4005: 'IN_CLASSB': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(290): note: see previous definition of 'IN_CLASSB'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(589): warning C4005: 'IN_CLASSC': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(296): note: see previous definition of 'IN_CLASSC'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(600): warning C4005: 'INADDR_ANY': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(301): note: see previous definition of 'INADDR_ANY'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(602): warning C4005: 'INADDR_BROADCAST': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(303): note: see previous definition of 'INADDR_BROADCAST'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2def.h(638): error C2011: 'sockaddr_in': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(309): note: see declaration of 'sockaddr_in'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(136): error C2011: 'fd_set': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(65): note: see declaration of 'fd_set'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(156): warning C4005: 'FD_CLR': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(94): note: see previous definition of 'FD_CLR'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(171): warning C4005: 'FD_SET': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(99): note: see previous definition of 'FD_SET'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(180): error C2011: 'timeval': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(108): note: see declaration of 'timeval'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(236): error C2011: 'hostent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(164): note: see declaration of 'hostent'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(249): error C2011: 'netent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(177): note: see declaration of 'netent'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(256): error C2011: 'servent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(184): note: see declaration of 'servent'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(268): error C2011: 'protoent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(196): note: see declaration of 'protoent'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(364): error C2011: 'WSAData': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(319): note: see declaration of 'WSAData'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(462): error C2011: 'sockproto': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(491): note: see declaration of 'sockproto'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(504): error C2011: 'linger': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(528): note: see declaration of 'linger'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(517): warning C4005: 'SOMAXCONN': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(541): note: see previous definition of 'SOMAXCONN'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(552): warning C4005: 'FD_READ': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(559): note: see previous definition of 'FD_READ'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(555): warning C4005: 'FD_WRITE': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(560): note: see previous definition of 'FD_WRITE'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(558): warning C4005: 'FD_OOB': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(561): note: see previous definition of 'FD_OOB'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(561): warning C4005: 'FD_ACCEPT': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(562): note: see previous definition of 'FD_ACCEPT'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(564): warning C4005: 'FD_CONNECT': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(563): note: see previous definition of 'FD_CONNECT'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(567): warning C4005: 'FD_CLOSE': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(564): note: see previous definition of 'FD_CLOSE'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1625): error C2375: 'accept': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(739): note: see declaration of 'accept'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1647): error C2375: 'bind': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(744): note: see declaration of 'bind'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1668): error C2375: 'closesocket': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(749): note: see declaration of 'closesocket'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1685): error C2375: 'connect': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(751): note: see declaration of 'connect'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1706): error C2375: 'ioctlsocket': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(756): note: see declaration of 'ioctlsocket'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1729): error C2375: 'getpeername': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(761): note: see declaration of 'getpeername'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1750): error C2375: 'getsockname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(766): note: see declaration of 'getsockname'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1771): error C2375: 'getsockopt': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(771): note: see declaration of 'getsockopt'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1796): error C2375: 'htonl': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(778): note: see declaration of 'htonl'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1813): error C2375: 'htons': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(780): note: see declaration of 'htons'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1831): error C2375: 'inet_addr': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(782): note: see declaration of 'inet_addr'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1849): error C2375: 'inet_ntoa': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(784): note: see declaration of 'inet_ntoa'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1949): error C2375: 'listen': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(786): note: see declaration of 'listen'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1968): error C2375: 'ntohl': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(790): note: see declaration of 'ntohl'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1985): error C2375: 'ntohs': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(792): note: see declaration of 'ntohs'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2002): error C2375: 'recv': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(794): note: see declaration of 'recv'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2025): error C2375: 'recvfrom': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(800): note: see declaration of 'recvfrom'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2052): error C2375: 'select': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(808): note: see declaration of 'select'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2077): error C2375: 'send': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(815): note: see declaration of 'send'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2100): error C2375: 'sendto': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(821): note: see declaration of 'sendto'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2127): error C2375: 'setsockopt': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(829): note: see declaration of 'setsockopt'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2152): error C2375: 'shutdown': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(836): note: see declaration of 'shutdown'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2172): error C2375: 'socket': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(840): note: see declaration of 'socket'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2197): error C2375: 'gethostbyaddr': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(847): note: see declaration of 'gethostbyaddr'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2219): error C2375: 'gethostbyname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(852): note: see declaration of 'gethostbyname'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2236): error C2375: 'gethostname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(854): note: see declaration of 'gethostname'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2276): error C2375: 'getservbyport': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(858): note: see declaration of 'getservbyport'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2295): error C2375: 'getservbyname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(862): note: see declaration of 'getservbyname'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2314): error C2375: 'getprotobynumber': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(866): note: see declaration of 'getprotobynumber'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2331): error C2375: 'getprotobyname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(868): note: see declaration of 'getprotobyname'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2351): error C2375: 'WSAStartup': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(872): note: see declaration of 'WSAStartup'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2371): error C2375: 'WSACleanup': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(876): note: see declaration of 'WSACleanup'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2388): error C2375: 'WSASetLastError': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(878): note: see declaration of 'WSASetLastError'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2405): error C2375: 'WSAGetLastError': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(880): note: see declaration of 'WSAGetLastError'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2426): error C2375: 'WSAIsBlocking': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(882): note: see declaration of 'WSAIsBlocking'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2444): error C2375: 'WSAUnhookBlockingHook': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(884): note: see declaration of 'WSAUnhookBlockingHook'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2462): error C2375: 'WSASetBlockingHook': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(886): note: see declaration of 'WSASetBlockingHook'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2480): error C2375: 'WSACancelBlockingCall': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(888): note: see declaration of 'WSACancelBlockingCall'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2498): error C2375: 'WSAAsyncGetServByName': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(890): note: see declaration of 'WSAAsyncGetServByName'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2526): error C2375: 'WSAAsyncGetServByPort': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(898): note: see declaration of 'WSAAsyncGetServByPort'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2554): error C2375: 'WSAAsyncGetProtoByName': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(906): note: see declaration of 'WSAAsyncGetProtoByName'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2580): error C2375: 'WSAAsyncGetProtoByNumber': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(913): note: see declaration of 'WSAAsyncGetProtoByNumber'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2606): error C2375: 'WSAAsyncGetHostByName': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(920): note: see declaration of 'WSAAsyncGetHostByName'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2632): error C2375: 'WSAAsyncGetHostByAddr': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(927): note: see declaration of 'WSAAsyncGetHostByAddr'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2662): error C2375: 'WSACancelAsyncRequest': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(936): note: see declaration of 'WSACancelAsyncRequest'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(2680): error C2375: 'WSAAsyncSelect': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(938): note: see declaration of 'WSAAsyncSelect'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(135): warning C4005: 'IP_TOS': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(349): note: see previous definition of 'IP_TOS'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(136): warning C4005: 'IP_TTL': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(348): note: see previous definition of 'IP_TTL'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(137): warning C4005: 'IP_MULTICAST_IF': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(343): note: see previous definition of 'IP_MULTICAST_IF'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(138): warning C4005: 'IP_MULTICAST_TTL': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(344): note: see previous definition of 'IP_MULTICAST_TTL'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(139): warning C4005: 'IP_MULTICAST_LOOP': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(345): note: see previous definition of 'IP_MULTICAST_LOOP'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(140): warning C4005: 'IP_ADD_MEMBERSHIP': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(346): note: see previous definition of 'IP_ADD_MEMBERSHIP'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(141): warning C4005: 'IP_DROP_MEMBERSHIP': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(347): note: see previous definition of 'IP_DROP_MEMBERSHIP'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(142): warning C4005: 'IP_DONTFRAGMENT': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(350): note: see previous definition of 'IP_DONTFRAGMENT'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(740): error C2011: 'ip_mreq': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock.h(360): note: see declaration of 'ip_mreq'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(917): error C2061: syntax error: identifier 'IPPROTO'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(921): error C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(981): error C2061: syntax error: identifier 'IPPROTO'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared\ws2ipdef.h(984): error C2059: syntax error: '}'
zapashcanon commented 1 year ago

What would be the easiest way for me to reproduce this ? I don't have any windows computer.

Also, is it possible to add this to the CI ?

jonahbeckford commented 1 year ago

I don't see an easy way to reproduce without a Windows computer. But full-disclosure: this is less of a priority for me now. It is easier for me to adopt the xdg package as-is but more importantly xdg and github.com/ocaml/ocaml are getting aligned in their xdg directory choices on Windows (cf. https://github.com/ocaml/ocaml/pull/12364).