Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/windows/winlean.nim
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ type
fd_count*: cint # unsigned
fd_array*: array[0..FD_SETSIZE-1, SocketHandle]

AddrInfo* = object
AddrInfo* {.importc: "ADDRINFOA", header: "ws2tcpip.h".} = object
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASCII structure in 2025, you joking?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ADDRINFOA is applicable to getaddrinfo. If you want ADDRINFOW, then you should use GetAddrInfoW.

Currently, the Nim standard library uses getaddrinfo, and the GetAddrInfoW function is not imported. Users may need to import it themselves.

Nim/lib/windows/winlean.nim

Lines 571 to 576 in 10c9eba

proc getaddrinfo*(nodename, servname: cstring, hints: ptr AddrInfo,
res: var ptr AddrInfo): cint {.
stdcall, importc: "getaddrinfo", dynlib: ws2dll.}
proc freeAddrInfo*(ai: ptr AddrInfo) {.
stdcall, importc: "freeaddrinfo", dynlib: ws2dll.}

ai_flags*: cint ## Input flags.
ai_family*: cint ## Address family of socket.
ai_socktype*: cint ## Socket type.
Expand Down