# HG changeset patch # User Owen Taylor # Date 1203976698 -3600 # Node ID ea543fec7afd87b5cc714593d390a8fe43b2dc26 # Parent f44b206faf547b758409aac76113263d7de846f2 Protect EAI_NODATA with #ifdef. Fixes LM-120. A recent change to GNU libc changes the EAI_NODATA constant in netdb.h to only be defined when _GNU_SOURCE is defined. A google for "loudmouth EAI_NODATA" indicates that EAI_NODATA is also problematical on FreeBSD. I'm attaching a patch that protects the usage of EAI_NODATA with an ifdef ... I think this is preferable to the sledgehammer of _GNU_SOURCE; while GNU libc can apparently still return this error value, using the default message in this rare corner case should not be a problem. committer: Mikael Hallendal diff -r f44b206faf54 -r ea543fec7afd loudmouth/lm-sock.c --- a/loudmouth/lm-sock.c Mon Feb 25 22:52:41 2008 +0100 +++ b/loudmouth/lm-sock.c Mon Feb 25 22:58:18 2008 +0100 @@ -279,9 +279,14 @@ case EAI_FAIL: return _("The nameserver encountered errors " "looking up this address"); + /* EAI_NODATA is apparently missing on FreeBSD. On recent GNU libc, + * it requires _GNU_SOURCE to be defined; in the unlikely case that + * that GNU libc returns this value we'll return the default message */ +#ifdef EAI_NODATA case EAI_NODATA: return _("The remote host exists but no address " "is available"); +#endif case EAI_NONAME: return _("The remote address is unknown"); case EAI_FAMILY: