bug-gnulib
[Top][All Lists]
Advanced

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

Re: gethostname on Windows


From: Simon Josefsson
Subject: Re: gethostname on Windows
Date: Mon, 03 Aug 2009 10:13:53 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.96 (gnu/linux)

Bruno Haible <address@hidden> writes:

> You are right. In summary:
>
>    - GetComputerNameEx(ComputerNameDnsHostname,...) returns the right 
> hostname,
>      but it hard to use portably:
>        - It requires defining _WIN32_WINNT to at least 0x0500.
>        - With mingw, it also requires
>          "#define GetComputerNameEx GetComputerNameExA".
>        - With older versions of mingw, none of the declarations are present at
>          all, not even of the enum value ComputerNameDnsHostname.
>    - GetComputerName() does not return the right kind of hostname.
>    - gethostname() requires linking with -lws2_32.
>
> I'm now convinced that linking with -lws2_32 is the least evil.
> I have applied your patch from 2009-03-31.

Great, thanks.  I fixed a minor typo in the comment and pushed that.

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]