I have a little compatibility problem with MINGW that I'd like to resolve. I am trying to resolve a hostname, and am using the getaddrinfo/freeaddrinfo family of functions. In the Platform SDK, it has a big family of declarations that include a ANSI/Unicode 'aliii' (aliases) for:
GetAddrInfo: getaddrinfo/GetAddrInfoW
FreeAddrInfo: freeaddrinfo/FreeAddrInfoW
ADDRINFOT: addrinfo/addrinfoW
However, MINGW only defines ANSI versions. So, I try to compile an application under the mingw system, and it fails saying ADDRINFOT is undefined. I use the PSDK ws2tcpip.h, and I get errors regarding some inline asm that doesn't work with g++, and realize that it doesn't matter because the libraries wouldn't work.
So, purely for fun, I try to add the declarations in the MINGW header, and then just get linker errors for GetAddrInfoW/FreeAddrInfoW. Surely, the ws2_32 dll is a system one that implements both the ANSI and Unicode functions. Are they just unsupported in other ways? There aren't way's to add entries to the mingw import libraries are there?
Is there a feasable workaround for this issue?