Re: [PATCH] Check for getaddrinfo via configure test
Felix Janda <[email protected]> Fri, 15 Jan 2016 16:59:50 +0100
| Newsgroups | gmane.comp.gnome.apps.gkrellm |
|---|---|
| Message-ID | <20160115155950.GA296@nyan> |
Stefan Gehn wrote: > On 23/12/15 14:36, Felix Janda wrote: > > Fixes the compilation error "redefinition of addrinfo" on linux systems > > using the musl c library. > > This breaks getaddrinfo detection on Windows, the configure check does > not work since because of missing headers. > > Can anybody test some of the other platforms with this patch applied? It > would be a pity if the configure check fails on other platforms which > previously had getaddrinfo enabled. > > I'll provide a fix for Windows soonish. Shouldn't be hard to either > hardcode this or adapt the configure check accordingly. Sorry for the bad patch. 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). Felix