Re: [PATCH] Check for getaddrinfo via configure test

Felix Janda <[email protected]> Sun, 24 Jan 2016 17:13:52 +0100
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <20160124161352.GA3163@nyan>
Stefan Gehn wrote:
> On 15/01/16 16:59, Felix Janda wrote:
> > 
> > Sorry for the bad patch.
> 
> no problem. It's hard to write correct code when you're dealing with
> multiple platforms while at the same time only testing on one or two of
> them at most.
> 
> > I think that the configure test also won't work for Solaris, since
> > there it seems to be necessary to link with -lsocket -lnsl for
> > getaddrinfo. I guess that an accurate configure test would be not much
> > less complicated than the ifdef logic...
> > 
> > 
> > Would it maybe be possible to change the linux ifdefs from
> > 
> > #if defined(__GLIBC__) && ((__GLIBC__>2)||(__GLIBC__==2 && __GLIBC_MINOR__>=1))
> > 
> > to
> > 
> > #if !defined(__GLIBC__) || ((__GLIBC__>2)||(__GLIBC__==2 && __GLIBC_MINOR__>=1))
> > 
> > ? Or maybe leave them out together (glibc-2.1 is from 1999).
> 
> Thanks for pointing out the age. Every Linux system should have
> getaddrinfo() by now so I simply dropped the check.

Thanks, now everything compiles fine.

Felix