Re: [xml] win32 getaddrinfo

Rob Richards wrote:
Michael Stahl wrote:
Daniel Veillard wrote:
On Tue, Apr 01, 2008 at 10:23:56AM +0200, Michael Stahl wrote:
Roumen Petrov wrote:
to quote the msdn documentation:

The freeaddrinfo function was added to the Ws2_32.dll on Windows XP and later.
When the Wspiapi.h include file is added, the freeaddrinfo function is defined to the WspiapiFreeAddrInfo inline function in the Wspiapi.h file.
the question is how do you detect that + #include <Wspiapi.h> /* for getaddrinfo, freeaddrinfo */ is actually available ? What about older version, WinCE ...
I guess this need some expert review (I'm not one for any Win stuff !)
me neither, i just quote msdn :)

Declared in Ws2tcpip.h on Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Declared in Ws2tcpip.h on Windows 2000, Windows NT, and Windows Me/98/95; include Wspiapi.h.

so, it says nothing about wince, but everything else from msft seems to have it.

What are you compiling with? The use of getaddrinfo actually came about due to an issue with win98.

I'm curious to know how HAVE_GETADDRINFO ended up getting defined.


Next is quoted from mingw ws2tcpip.h:
#if (_WIN32_WINNT >= 0x0501)
void WSAAPI freeaddrinfo (struct addrinfo*);
int WSAAPI getaddrinfo (const char*,const char*,const struct addrinfo*,
                        struct addrinfo**);
int WSAAPI getnameinfo(const struct sockaddr*,socklen_t,char*,DWORD,
/* FIXME: Need WS protocol-independent API helpers.  */

But since it is a stdcall function configure cannot detect it and the in mingw case code will use gethostbyname even we configure with CPPFLAGS="-DWINVER=0x0501" (this set _WIN32_WINNT to specified WINVER).

Michael, please could you check preprocessor output.
May be in you case GetAddrInfo is defined by <ws2tcpip.h>.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]