Bruno Haible <br...@clisp.org> 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