[Libssh] Windows patch

Keisial keisial at gmail.com
Tue Mar 4 23:09:19 CET 2008


Alexander Lamaison wrote:
> A couple of questions:
>
>   
>> I attach a patch which should makes libssh work on any 32-bit windows
>> with getaddrinfo.
>>     
>
> This should be any 32-bit windows according to MSDN.  I noticed that your
> patch includes:
>     #define _WIN32_WINNT 0x0501 //getaddrinfo, freeaddrinfo
> Is such a high version of Windows (2k?) required for these two functions?
>   
MSDN says it's available since Windows 95, but the prototype isn't 
included unless
_WIN32_WINNT >= 0x0501
0x0501 means Windows Server 2003, Windows XP. Previous windows didn't 
include a built-in
getaddrinfo()

>> A dummy gai_strerror.c was copied from glibc because windows misses
>> that function.
>>     
>
> According to http://msdn2.microsoft.com/en-us/library/ms738514(VS.85).aspx
> gai_strerror() is in Wspiapi.h.  Can this not be used?
>
> I am fairly new to Windows programming so forgive me if these questions are
> due to my ignorance.
>
> Alex
>   
They're completely logical. It's include madness (i'm using the 
mingw's). My header says: "These are not
exported from any known w32api library.  Are they implemented as macros 
or inline finctions?"
Well, it *is* an inline function on windows Ws2tcpip.h Rechecking, newer 
headers do set it as inline, so
we can probably leave gai_strerror.c out.



More information about the Libssh mailing list